This is bug 131839 for Linux.
Created attachment 263512 [details] Patch
Comment on attachment 263512 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=263512&action=review I can't comment on the FreeType-specific stuff, but this approach looks good to me. > Source/WebCore/platform/graphics/freetype/SimpleFontDataFreeType.cpp:72 > + if (TT_OS2* os2 = static_cast<TT_OS2*>(FT_Get_Sfnt_Table(freeTypeFace, ft_sfnt_os2))) { > + const FT_Short kUseTypoMetricsMask = 1 << 7; > + if (os2->fsSelection & kUseTypoMetricsMask) { There's really no FreeType API for this? :(
> There's really no FreeType API for this? :( I checked the Cairo and FreeType online documentation and could not find any easier way to retrieve the typo values (the yscale parameter was actually taken from Gecko's gfx/thebes/gfxFT2Utils.cpp and they also hardcode the use_typo_metrics bit). I just downloaded the freetype-2.6 source and searched for "typo" metrics but I did not find anything either...
Comment on attachment 263512 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=263512&action=review Looks good to me, except for a few nits. > Source/WebCore/platform/graphics/freetype/SimpleFontDataFreeType.cpp:70 > + if (TT_OS2* os2 = static_cast<TT_OS2*>(FT_Get_Sfnt_Table(freeTypeFace, ft_sfnt_os2))) { I think WebKit style specifies this should be called OS2Table instead of os2. > LayoutTests/fonts/use-typo-metrics-1.html:9 > + src: url("./lineheight5000-typolineheight2300.woff"); Is the "./" necessary here?
Created attachment 263619 [details] Patch final version Thanks!
Created attachment 263663 [details] Patch final version
Committed r191378: <http://trac.webkit.org/changeset/191378>