Summary: | [FreeType] Add support for the USE_TYPO_METRICS flag | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Frédéric Wang (:fredw) <fred.wang> | ||||||||
Component: | Text | Assignee: | Frédéric Wang (:fredw) <fred.wang> | ||||||||
Status: | RESOLVED FIXED | ||||||||||
Severity: | Normal | CC: | commit-queue, mmaxfield, mrobinson | ||||||||
Priority: | P2 | ||||||||||
Version: | WebKit Nightly Build | ||||||||||
Hardware: | PC | ||||||||||
OS: | Linux | ||||||||||
Bug Depends on: | |||||||||||
Bug Blocks: | 150394, 131839 | ||||||||||
Attachments: |
|
Description
Frédéric Wang (:fredw)
2015-10-19 14:06:16 PDT
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> |