Title: [262804] trunk/Source/WebCore
- Revision
- 262804
- Author
- [email protected]
- Date
- 2020-06-09 12:53:52 -0700 (Tue, 09 Jun 2020)
Log Message
[Win] ComplexTextControllerUniscribe: Retry ScriptShape with SCRIPT_UNDEFINED if it failed as USP_E_SCRIPT_NOT_IN_FONT
https://bugs.webkit.org/show_bug.cgi?id=212947
Reviewed by Don Olmstead.
If the given font doesn't support the givin text, ScriptShape API
fails as USP_E_SCRIPT_NOT_IN_FONT. In the case, the complex run
was simply ignored and nothing was drawn for the text.
According to Uniscribe document, We should retry ScriptShape with
SCRIPT_UNDEFINED to get missing glyphs.
<https://docs.microsoft.com/en-us/windows/win32/intl/displaying-text-with-uniscribe>
* platform/graphics/win/ComplexTextControllerUniscribe.cpp:
(WebCore::shapeByUniscribe):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (262803 => 262804)
--- trunk/Source/WebCore/ChangeLog 2020-06-09 19:39:46 UTC (rev 262803)
+++ trunk/Source/WebCore/ChangeLog 2020-06-09 19:53:52 UTC (rev 262804)
@@ -1,5 +1,23 @@
2020-06-09 Fujii Hironori <[email protected]>
+ [Win] ComplexTextControllerUniscribe: Retry ScriptShape with SCRIPT_UNDEFINED if it failed as USP_E_SCRIPT_NOT_IN_FONT
+ https://bugs.webkit.org/show_bug.cgi?id=212947
+
+ Reviewed by Don Olmstead.
+
+ If the given font doesn't support the givin text, ScriptShape API
+ fails as USP_E_SCRIPT_NOT_IN_FONT. In the case, the complex run
+ was simply ignored and nothing was drawn for the text.
+
+ According to Uniscribe document, We should retry ScriptShape with
+ SCRIPT_UNDEFINED to get missing glyphs.
+ <https://docs.microsoft.com/en-us/windows/win32/intl/displaying-text-with-uniscribe>
+
+ * platform/graphics/win/ComplexTextControllerUniscribe.cpp:
+ (WebCore::shapeByUniscribe):
+
+2020-06-09 Fujii Hironori <[email protected]>
+
ComplexTextController: Use std::sort to calculate m_runIndices
https://bugs.webkit.org/show_bug.cgi?id=212944
Modified: trunk/Source/WebCore/platform/graphics/win/ComplexTextControllerUniscribe.cpp (262803 => 262804)
--- trunk/Source/WebCore/platform/graphics/win/ComplexTextControllerUniscribe.cpp 2020-06-09 19:39:46 UTC (rev 262803)
+++ trunk/Source/WebCore/platform/graphics/win/ComplexTextControllerUniscribe.cpp 2020-06-09 19:53:52 UTC (rev 262804)
@@ -34,7 +34,7 @@
namespace WebCore {
-static bool shapeByUniscribe(const UChar* str, int len, SCRIPT_ITEM item, const Font* fontData,
+static bool shapeByUniscribe(const UChar* str, int len, SCRIPT_ITEM& item, const Font* fontData,
Vector<WORD>& glyphs, Vector<WORD>& clusters,
Vector<SCRIPT_VISATTR>& visualAttributes)
{
@@ -60,8 +60,11 @@
// Need to resize our buffers.
glyphs.resize(glyphs.size() * 2);
visualAttributes.resize(glyphs.size());
- }
- } while (shapeResult == E_PENDING || shapeResult == E_OUTOFMEMORY);
+ } else if (shapeResult == USP_E_SCRIPT_NOT_IN_FONT)
+ item.a.eScript = SCRIPT_UNDEFINED;
+ else
+ break;
+ } while (true);
if (hdc)
SelectObject(hdc, oldFont);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes