[webkit-changes] [WebKit/WebKit] d62134: Don't mix up glyph IDs when multiple installed fon...
fantasai
noreply at github.com
Tue Jul 16 15:09:29 PDT 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: d621347fbb522a61863862482451ae76e47d696f
https://github.com/WebKit/WebKit/commit/d621347fbb522a61863862482451ae76e47d696f
Author: Elika Etemad <fantasai.bugs at inkedblade.net>
Date: 2024-07-16 (Tue, 16 Jul 2024)
Changed paths:
A LayoutTests/fast/text/font-fallback-expected.html
A LayoutTests/fast/text/font-fallback.html
A LayoutTests/fast/text/postscript-bold-expected.html
A LayoutTests/fast/text/postscript-bold.html
M LayoutTests/platform/win/TestExpectations
M Source/WebCore/platform/graphics/Font.h
M Source/WebCore/platform/graphics/FontPlatformData.h
M Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp
M Source/WebCore/platform/graphics/coretext/FontCascadeCoreText.cpp
M Source/WebCore/platform/graphics/coretext/FontCoreText.cpp
M Source/WebCore/platform/graphics/coretext/FontPlatformDataCoreText.cpp
M Source/WebCore/platform/graphics/mac/ComplexTextControllerCoreText.mm
Log Message:
-----------
Don't mix up glyph IDs when multiple installed fonts share a name
https://bugs.webkit.org/show_bug.cgi?id=167068
rdar://129891005
Reviewed by Vitor Roriz.
On CoreText platforms, we store two CTFontRefs for a given Font.
If they end up pointing to different fonts, this causes major problems
such as mixing up glyph IDs and rendering nonsense text.
This patch merges them into a single object by
* Dropping the LastResort CoreText fallback, which seems no longer needed.
* Applying the width variants for all uses, which should be more correct anyway.
* Updating all callers accordingly.
* Source/WebCore/platform/graphics/Font.h:
(WebCore::Font::getCTFont const):
* Source/WebCore/platform/graphics/FontPlatformData.h:
(WebCore::FontPlatformData::ctFont const):
(WebCore::FontPlatformData::font const): Deleted.
* Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::FontCache::systemFallbackForCharacterCluster):
* Source/WebCore/platform/graphics/coretext/FontCascadeCoreText.cpp:
(WebCore::FontCascade::primaryFontIsSystemFont const):
* Source/WebCore/platform/graphics/coretext/FontCoreText.cpp:
(WebCore::Font::platformInit):
(WebCore::Font::platformCharWidthInit):
(WebCore::Font::supportsSmallCaps const):
(WebCore::Font::supportsAllSmallCaps const):
(WebCore::Font::supportsPetiteCaps const):
(WebCore::Font::supportsAllPetiteCaps const):
(WebCore::Font::createFontWithoutSynthesizableFeatures const):
(WebCore::Font::platformCreateScaledFont const):
(WebCore::Font::platformWidthForGlyph const):
(WebCore::Font::applyTransforms const):
(WebCore::Font::determinePitch):
(WebCore::Font::platformBoundsForGlyph const):
(WebCore::Font::platformPathForGlyph const):
(WebCore::Font::platformSupportsCodePoint const):
(WebCore::Font::isProbablyOnlyUsedToRenderIcons const):
(WebCore::Font::otSVGTable const):
(WebCore::Font::hasComplexColorFormatTables const):
* Source/WebCore/platform/graphics/coretext/FontPlatformDataCoreText.cpp:
(WebCore::mapFontWidthVariantToCTFeatureSelector):
(WebCore::FontPlatformData::FontPlatformData):
(WebCore::FontPlatformData::updateSize):
(WebCore::FontPlatformData::toIPCData const):
(WebCore::cascadeToLastResortAttributesDictionary): Deleted.
(WebCore::cascadeToLastResortAndVariationsFontDescriptor): Deleted.
(WebCore::FontPlatformData::ctFont const): Deleted.
* Source/WebCore/platform/graphics/mac/ComplexTextControllerCoreText.mm:
(WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
Canonical link: https://commits.webkit.org/281022@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