[webkit-changes] [WebKit/WebKit] 0df29c: [Win] Support USE_TYPO_METRICS flag
Fujii Hironori
noreply at github.com
Fri Jun 28 14:55:45 PDT 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 0df29c6b290b4cc961c34097fb02b7d2c8c491e1
https://github.com/WebKit/WebKit/commit/0df29c6b290b4cc961c34097fb02b7d2c8c491e1
Author: Fujii Hironori <Hironori.Fujii at sony.com>
Date: 2024-06-28 (Fri, 28 Jun 2024)
Changed paths:
A LayoutTests/fonts/resources/use-typo-metrics-2.py
A LayoutTests/fonts/resources/use-typo-metrics-2.ttf
A LayoutTests/fonts/use-typo-metrics-2-expected.html
A LayoutTests/fonts/use-typo-metrics-2.html
M Source/WebCore/platform/graphics/win/SimpleFontDataWin.cpp
Log Message:
-----------
[Win] Support USE_TYPO_METRICS flag
https://bugs.webkit.org/show_bug.cgi?id=275892
Reviewed by Frédéric Wang.
Windows WebKit was using incorrect font metrics for Google Sans font
on Google News. The font uses USE_TYPO_METRICS flag.
If USE_TYPO_METRICS flag is set in fsSelection of OS/2 table, The font
should use typo metrics in the table.
<https://learn.microsoft.com/en-us/typography/opentype/spec/os2>
> If set, it is strongly recommended that applications use
> OS/2.sTypoAscender - OS/2.sTypoDescender + OS/2.sTypoLineGap as the
> default line spacing for this font.
USE_TYPO_METRICS flag support was added by
<https://commits.webkit.org/168985@main> for Windows port once.
However, it was reverted by <https://commits.webkit.org/213183@main>
for three reasons. 1) The descent was wrongly calculated. The negative
value should have been inverted. 2) The test case
fonts/use-typo-metrics-1.html didn't pass. Windows API
GetOutlineTextMetrics doesn't preserve USE_TYPO_METRICS flag for
OpenType fonts. 3) I didn't know actual web pages having layout
problems.
Google Sans font on Google News is using the USE_TYPO_METRICS flag,
and GetOutlineTextMetrics preserves the flag of the font. Restored the
original implementation with fixing the negative descent problem.
Added a new test case using a TrueType font.
* LayoutTests/fonts/resources/use-typo-metrics-2.py: Added.
* LayoutTests/fonts/resources/use-typo-metrics-2.ttf: Added.
* LayoutTests/fonts/use-typo-metrics-2-expected.html: Added.
* LayoutTests/fonts/use-typo-metrics-2.html: Added.
* Source/WebCore/platform/graphics/win/SimpleFontDataWin.cpp:
Canonical link: https://commits.webkit.org/280480@main
To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications
More information about the webkit-changes
mailing list