Bug 199186 - [WinCairo] fonts/use-typo-metrics-1.html is failing as ImageOnlyFailure
Summary: [WinCairo] fonts/use-typo-metrics-1.html is failing as ImageOnlyFailure
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-06-25 01:07 PDT by Fujii Hironori
Modified: 2019-06-25 20:05 PDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Fujii Hironori 2019-06-25 01:07:11 PDT
[WinCairo] fonts/use-typo-metrics-1.html is failing as ImageOnlyFailure

It seems that GetOutlineTextMetrics doesn't preserve OS/2 USE_TYPO_METRICS flag for OpenType fonts.
fonts/lineheight5000-typolineheight2300.woff seems a WOFF generated from a OpenType font.
If I convert lineheight5000-typolineheight2300.woff to TTF, and converted back to WOFF, the test case will pass.

Firefox seems using HarfBuzz to get OS/2 section on Windows.
Comment 1 Frédéric Wang (:fredw) 2019-06-25 03:11:37 PDT
I wonder if the tools you use to convert to TTF and WOFF again might do extra sanitisation changes. 

Are you able to use the script to generate a TTF and then load directly the .ttf file with @font-face rule?
Comment 2 Fujii Hironori 2019-06-25 20:05:20 PDT
I created lineheight5000-typolineheight2300.ttf.
I confirmed USE_TYPO_METRICS flag is preserved, the test can pass.

diff --git a/mathml/tools/use-typo-lineheight.py b/mathml/tools/use-typo-lineheight.py
index 9768979f48..c98020868b 100644
--- a/mathml/tools/use-typo-lineheight.py
+++ b/mathml/tools/use-typo-lineheight.py
@@ -44,7 +44,7 @@ font.os2_windescent_add = False
 
 font.os2_use_typo_metrics = True
 
-path = "../../fonts/math/lineheight%d-typolineheight%d.woff" % (winHeight, typoLineHeight)
+path = "../../fonts/math/lineheight%d-typolineheight%d.ttf" % (winHeight, typoLineHeight)
 print("Generating %s..." % path, end="")
 font.generate(path)
 if font.validate() == 0: