Changeset 245094 in webkit
- Timestamp:
- May 8, 2019 11:06:27 PM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r245090 r245094 1 2019-05-08 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 REGRESSION(r239915): [FreeType] White space skipped when rendering plain text with noto CJK font 4 https://bugs.webkit.org/show_bug.cgi?id=197658 5 6 Reviewed by Michael Catanzaro. 7 8 Since r239915 we no longer overwrite control characters with zero width space, they are handled later when 9 filling the glyph pages. In Font::platformGlyphInit() there's an optimization to get the glyph of zero with 10 space character that assumes that control characters are always overwritten. Since the glyph for character at 0 11 index is always overwritten with zero width space, we can avoid loading the page for the actual zero width space 12 character and use the first page instead. In the particular case of noto CJK font, character at 0 is mapped to 13 the same glyph as space character, so space and zero width space end up being the same glyph. That breaks the 14 space width calculation, that returns 0 when isZeroWidthSpaceGlyph() is true. That's why spaces are no 15 longer rendered, ComplexTextController::adjustGlyphsAndAdvances() is setting the x advance for the space glyphs 16 to 0. 17 18 * platform/graphics/Font.cpp: 19 (WebCore::Font::platformGlyphInit): Use the actual zero width space page to get the glyph instead of 0 when 20 using FreeType. 21 1 22 2019-05-08 Alex Christensen <achristensen@webkit.org> 2 23 -
trunk/Source/WebCore/platform/graphics/Font.cpp
r243163 r245094 103 103 void Font::platformGlyphInit() 104 104 { 105 auto* glyphPageZero = glyphPage(0); 105 #if USE(FREETYPE) 106 auto* glyphPageZeroWidthSpace = glyphPage(GlyphPage::pageNumberForCodePoint(zeroWidthSpace)); 107 UChar32 zeroWidthSpaceCharacter = zeroWidthSpace; 108 #else 109 // Ask for the glyph for 0 to avoid paging in ZERO WIDTH SPACE. Control characters, including 0, 110 // are mapped to the ZERO WIDTH SPACE glyph for non FreeType based ports. 111 auto* glyphPageZeroWidthSpace = glyphPage(0); 112 UChar32 zeroWidthSpaceCharacter = 0; 113 #endif 106 114 auto* glyphPageCharacterZero = glyphPage(GlyphPage::pageNumberForCodePoint('0')); 107 115 auto* glyphPageSpace = glyphPage(GlyphPage::pageNumberForCodePoint(space)); 108 116 109 // Ask for the glyph for 0 to avoid paging in ZERO WIDTH SPACE. Control characters, including 0, 110 // are mapped to the ZERO WIDTH SPACE glyph. 111 if (glyphPageZero) 112 m_zeroWidthSpaceGlyph = glyphPageZero->glyphDataForCharacter(0).glyph; 117 if (glyphPageZeroWidthSpace) 118 m_zeroWidthSpaceGlyph = glyphPageZeroWidthSpace->glyphDataForCharacter(zeroWidthSpaceCharacter).glyph; 113 119 114 120 // Nasty hack to determine if we should round or ceil space widths.
Note: See TracChangeset
for help on using the changeset viewer.