WebKit Bugzilla
Attachment 369368 Details for
Bug 197658
: REGRESSION(r239915): [FreeType] White space skipped when rendering plain text with noto CJK font
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
wcore-ft-space-width.diff (text/plain), 3.17 KB, created by
Carlos Garcia Campos
on 2019-05-08 02:37:31 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Carlos Garcia Campos
Created:
2019-05-08 02:37:31 PDT
Size:
3.17 KB
patch
obsolete
>diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 26177d0480c..592b2ee339f 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,24 @@ >+2019-05-08 Carlos Garcia Campos <cgarcia@igalia.com> >+ >+ REGRESSION(r239915): [FreeType] White space skipped when rendering plain text with noto CJK font >+ https://bugs.webkit.org/show_bug.cgi?id=197658 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Since r239915 we no longer overwrite control characters with zero width space, they are handled later when >+ filling the glyph pages. In Font::platformGlyphInit() there's an optimization to get the glyph of zero with >+ space character that assumes that control characters are always overwritten. Since the glyph for character at 0 >+ index is always overwritten with zero width space, we can avoid loading the page for the actual zero width space >+ character and use the first page instead. In the particular case of noto CJK font, character at 0 is mapped to >+ the same glyph as space character, so space and zero width space end up being the same glyph. That breaks the >+ space width calculation, that returns 0 when isZeroWidthSpaceGlyph() is true. That's why spaces are no >+ longer rendered, ComplexTextController::adjustGlyphsAndAdvances() is setting the x advance for the space glyphs >+ to 0. >+ >+ * platform/graphics/Font.cpp: >+ (WebCore::Font::platformGlyphInit): Use the actual zero width space page to get the glyph instead of 0 when >+ using FreeType. >+ > 2019-05-07 Antti Koivisto <antti@apple.com> > > <body> with overflow:hidden CSS is scrollable on iOS >diff --git a/Source/WebCore/platform/graphics/Font.cpp b/Source/WebCore/platform/graphics/Font.cpp >index eb5a17bf180..cc94d6cdcff 100644 >--- a/Source/WebCore/platform/graphics/Font.cpp >+++ b/Source/WebCore/platform/graphics/Font.cpp >@@ -102,14 +102,20 @@ void Font::initCharWidths() > > void Font::platformGlyphInit() > { >- auto* glyphPageZero = glyphPage(0); >+#if USE(FREETYPE) >+ auto* glyphPageZeroWidthSpace = glyphPage(GlyphPage::pageNumberForCodePoint(zeroWidthSpace)); >+ UChar32 zeroWidthSpaceCharacter = zeroWidthSpace; >+#else >+ // Ask for the glyph for 0 to avoid paging in ZERO WIDTH SPACE. Control characters, including 0, >+ // are mapped to the ZERO WIDTH SPACE glyph for non FreeType based ports. >+ auto* glyphPageZeroWidthSpace = glyphPage(0); >+ UChar32 zeroWidthSpaceCharacter = 0; >+#endif > auto* glyphPageCharacterZero = glyphPage(GlyphPage::pageNumberForCodePoint('0')); > auto* glyphPageSpace = glyphPage(GlyphPage::pageNumberForCodePoint(space)); > >- // Ask for the glyph for 0 to avoid paging in ZERO WIDTH SPACE. Control characters, including 0, >- // are mapped to the ZERO WIDTH SPACE glyph. >- if (glyphPageZero) >- m_zeroWidthSpaceGlyph = glyphPageZero->glyphDataForCharacter(0).glyph; >+ if (glyphPageZeroWidthSpace) >+ m_zeroWidthSpaceGlyph = glyphPageZeroWidthSpace->glyphDataForCharacter(zeroWidthSpaceCharacter).glyph; > > // Nasty hack to determine if we should round or ceil space widths. > // If the font is monospace or fake monospace we ceil to ensure that
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
mcatanzaro
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 197658
: 369368 |
369373