[HarfBuzz] Width not correctly reported as 0 for zero font size
authorcarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 22 Dec 2018 12:33:52 +0000 (12:33 +0000)
committercarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 22 Dec 2018 12:33:52 +0000 (12:33 +0000)
https://bugs.webkit.org/show_bug.cgi?id=192986

Reviewed by Michael Catanzaro.

Fixes test fast/text/font-size-zero.html

* platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp:
(WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun): Use empty advances for glyphs when the font
size is zero.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239539 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp

index b04fa0e..8ecfee1 100644 (file)
@@ -1,3 +1,16 @@
+2018-12-22  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        [HarfBuzz] Width not correctly reported as 0 for zero font size
+        https://bugs.webkit.org/show_bug.cgi?id=192986
+
+        Reviewed by Michael Catanzaro.
+
+        Fixes test fast/text/font-size-zero.html
+
+        * platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp:
+        (WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun): Use empty advances for glyphs when the font
+        size is zero.
+
 2018-12-20  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
 
         Use Ref<> as much as possible
index 0e0aa6c..5532d18 100644 (file)
@@ -156,7 +156,7 @@ ComplexTextController::ComplexTextRun::ComplexTextRun(hb_buffer_t* buffer, const
         m_coreTextIndices[i] = glyphInfos[i].cluster;
 
         uint16_t glyph = glyphInfos[i].codepoint;
-        if (m_font.isZeroWidthSpaceGlyph(glyph)) {
+        if (m_font.isZeroWidthSpaceGlyph(glyph) || !m_font.platformData().size()) {
             m_glyphs[i] = glyph;
             m_baseAdvances[i] = { };
             m_glyphOrigins[i] = { };