Changeset 221909 in webkit
- Timestamp:
- Sep 12, 2017 4:21:36 AM (7 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r221908 r221909 1 2017-09-12 Fujii Hironori <Hironori.Fujii@sony.com> 2 3 [Freetype] Doesn't support coloured fonts 4 https://bugs.webkit.org/show_bug.cgi?id=156579 5 6 Reviewed by Michael Catanzaro. 7 8 Covered by existing tests. This needs a large rebaseline that will be done in follow up commits. 9 10 * platform/graphics/FontCascade.h: Enable advance text rendering mode by default. 11 (WebCore::FontCascade::advancedTextRenderingMode const): 12 (WebCore::FontCascade::computeRequiresShaping const): 13 * platform/graphics/freetype/SimpleFontDataFreeType.cpp: 14 (WebCore::Font::platformInit): Do not get metrics from OS/2 table for non-scalable fonts. 15 * platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp: 16 (WebCore::harfBuzzGetGlyph): Use U8_APPEND_UNSAFE() instead of converting to a String and then encoding it with 17 UTF8Encoding(). 18 1 19 2017-09-12 Frederic Wang <fwang@igalia.com> 2 20 -
trunk/Source/WebCore/platform/graphics/FontCascade.h
r219858 r221909 276 276 if (textRenderingMode == OptimizeSpeed) 277 277 return false; 278 #if PLATFORM(COCOA) 278 #if PLATFORM(COCOA) || USE(FREETYPE) 279 279 return true; 280 280 #else … … 295 295 bool computeRequiresShaping() const 296 296 { 297 #if PLATFORM(COCOA) 297 #if PLATFORM(COCOA) || USE(FREETYPE) 298 298 if (!m_fontDescription.variantSettings().isAllNormal()) 299 299 return true; -
trunk/Source/WebCore/platform/graphics/freetype/SimpleFontDataFreeType.cpp
r221858 r221909 90 90 // If the USE_TYPO_METRICS flag is set in the OS/2 table then we use typo metrics instead. 91 91 FT_Face freeTypeFace = cairoFtFaceLocker.ftFace(); 92 TT_OS2* OS2Table = freeTypeFace ? static_cast<TT_OS2*>(FT_Get_Sfnt_Table(freeTypeFace, ft_sfnt_os2)) : nullptr; 93 if (OS2Table) { 94 const FT_Short kUseTypoMetricsMask = 1 << 7; 95 if (OS2Table->fsSelection & kUseTypoMetricsMask) { 96 // FT_Size_Metrics::y_scale is in 16.16 fixed point format. 97 // Its (fractional) value is a factor that converts vertical metrics from design units to units of 1/64 pixels. 98 double yscale = (freeTypeFace->size->metrics.y_scale / 65536.0) / 64.0; 99 ascent = narrowPrecisionToFloat(yscale * OS2Table->sTypoAscender); 100 descent = -narrowPrecisionToFloat(yscale * OS2Table->sTypoDescender); 101 lineGap = narrowPrecisionToFloat(yscale * OS2Table->sTypoLineGap); 92 if (freeTypeFace && freeTypeFace->face_flags & FT_FACE_FLAG_SCALABLE) { 93 if (auto* OS2Table = static_cast<TT_OS2*>(FT_Get_Sfnt_Table(freeTypeFace, ft_sfnt_os2))) { 94 const FT_Short kUseTypoMetricsMask = 1 << 7; 95 if (OS2Table->fsSelection & kUseTypoMetricsMask) { 96 // FT_Size_Metrics::y_scale is in 16.16 fixed point format. 97 // Its (fractional) value is a factor that converts vertical metrics from design units to units of 1/64 pixels. 98 double yscale = (freeTypeFace->size->metrics.y_scale / 65536.0) / 64.0; 99 ascent = narrowPrecisionToFloat(yscale * OS2Table->sTypoAscender); 100 descent = -narrowPrecisionToFloat(yscale * OS2Table->sTypoDescender); 101 lineGap = narrowPrecisionToFloat(yscale * OS2Table->sTypoLineGap); 102 } 102 103 } 103 104 } -
trunk/Source/WebCore/platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp
r200129 r221909 100 100 cairo_glyph_t* glyphs = 0; 101 101 int numGlyphs = 0; 102 UChar ch = unicode; 103 CString utf8Codepoint = UTF8Encoding().encode(StringView(&ch, 1), QuestionMarksForUnencodables); 104 if (cairo_scaled_font_text_to_glyphs(scaledFont, 0, 0, utf8Codepoint.data(), utf8Codepoint.length(), &glyphs, &numGlyphs, 0, 0, 0) != CAIRO_STATUS_SUCCESS) 102 char buffer[U8_MAX_LENGTH]; 103 size_t bufferLength = 0; 104 U8_APPEND_UNSAFE(buffer, bufferLength, unicode); 105 if (cairo_scaled_font_text_to_glyphs(scaledFont, 0, 0, buffer, bufferLength, &glyphs, &numGlyphs, nullptr, nullptr, nullptr) != CAIRO_STATUS_SUCCESS) 105 106 return false; 106 107 if (!numGlyphs) -
trunk/Tools/ChangeLog
r221907 r221909 1 2017-09-12 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 [Freetype] Doesn't support coloured fonts 4 https://bugs.webkit.org/show_bug.cgi?id=156579 5 6 Reviewed by Michael Catanzaro. 7 8 Bump webkitgtk-test-fonts to 0.0.6 version that includes the EmijoOne font. 9 10 * gtk/jhbuild.modules: 11 * wpe/jhbuild.modules: 12 1 13 2017-09-11 Wenson Hsieh <wenson_hsieh@apple.com> 2 14 -
trunk/Tools/gtk/jhbuild.modules
r221727 r221909 111 111 <autotools id="fonts" supports-non-srcdir-builds="no" 112 112 skip-autogen="true"> 113 <branch repo="github.com" module=" mrobinson/webkitgtk-test-fonts.git" checkoutdir="webkitgtk-test-fonts" tag="0.0.5"/>113 <branch repo="github.com" module="WebKitGTK/webkitgtk-test-fonts.git" checkoutdir="webkitgtk-test-fonts" tag="0.0.6"/> 114 114 </autotools> 115 115 -
trunk/Tools/wpe/jhbuild.modules
r221858 r221909 93 93 <autotools id="fonts" supports-non-srcdir-builds="no" 94 94 skip-autogen="true"> 95 <branch repo="github.com" module=" mrobinson/webkitgtk-test-fonts.git" checkoutdir="webkitgtk-test-fonts" tag="0.0.5"/>95 <branch repo="github.com" module="WebKitGTK/webkitgtk-test-fonts.git" checkoutdir="webkitgtk-test-fonts" tag="0.0.6"/> 96 96 </autotools> 97 97
Note: See TracChangeset
for help on using the changeset viewer.