Bug 304530
| Summary: | outlook.com: Microsoft OWA: ETS:Font Mingliu renders malpositioned numbers in Safari | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Vitor Roriz <vitor.roriz> |
| Component: | New Bugs | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Vitor Roriz
So, the issue here is when author specify a generic font-family that is resolved to times (like serif) and specify a lang attribute.
When lang attribute is present we call FontDescription::platformResolveGenericFamily for resolving the font-family name with the locale.
For serif, this will result in SystemFontDatabaseCoreText::serifFamily(const String& locale) -> genericFamily() -> CreateDescriptorForCSSFamily(kCTFontCSSFamilySerif, "en-US”)
CreateDescriptorForCSSFamily(kCTFontCSSFamilySerif, "en-US") returns '.Times Fallback’ which, from what I understand, is considered as a UI font per core text. We can’t use that name for creating a font otherwise we get this error from CoreText:
CoreText note: Client requested name ".Times Fallback", it will get TimesNewRomanPSMT rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
However, our intent here wasn’t to request a UI font, we want serif (kCTFontCSSFamilySerif) and not serif-ui (kCTFontCSSFamilySerifUI). I wonder if this is a bug on CoreText or intentional, but anyway we can fix that on our side.
Just to be precise, CreateDescriptorForCSSFamily doesn’t return '.Times Fallback’ directly, but a descriptor which has this kCTFontFamilyNameAttribute attribute.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Vitor Roriz
rdar://139338599
Vitor Roriz
Pull request: https://github.com/WebKit/WebKit/pull/55739
EWS
Committed 304809@main (1ecb160d72f7): <https://commits.webkit.org/304809@main>
Reviewed commits have been landed. Closing PR #55739 and removing active labels.