New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Cocoa] font-variation-settings:opsz is not applied when text-rendering:optimizeLegibility is set #12301
Conversation
EWS run on previous version of this PR (hash 9da23d5)
|
9da23d5
to
4805c60
Compare
This depends on #12300 |
Oh, this needs a test. |
EWS run on previous version of this PR (hash 4805c60) |
4805c60
to
08e4eb3
Compare
EWS run on previous version of this PR (hash 08e4eb3) |
Source/WebCore/platform/graphics/cocoa/UnrealizedCoreTextFont.h
Outdated
Show resolved
Hide resolved
Source/WebCore/platform/graphics/cocoa/UnrealizedCoreTextFont.cpp
Outdated
Show resolved
Hide resolved
08e4eb3
to
267419f
Compare
EWS run on previous version of this PR (hash 267419f) |
267419f
to
2f726a9
Compare
EWS run on previous version of this PR (hash 2f726a9) |
|| (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MAX_ALLOWED < 180000) \ | ||
|| (PLATFORM(APPLETV) && __TV_OS_VERSION_MAX_ALLOWED < 180000) \ | ||
|| (PLATFORM(WATCHOS) && __WATCH_OS_VERSION_MAX_ALLOWED < 110000) | ||
#define USE_CORE_TEXT_OPTICAL_SIZING_WORKAROUND 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Workaround for what? A radar link in a comment would be good.
2f726a9
to
bcd51a2
Compare
EWS run on current version of this PR (hash bcd51a2) |
…ng:optimizeLegibility is set https://bugs.webkit.org/show_bug.cgi?id=254897 rdar://106814619 Reviewed by Simon Fraser. text-rendering:optimizeLegibility turns on kCTFontOpticalSizeAttribute:”auto” in Core Text, and font-variation-settings:opsz turns on kCTFontVariationAttribute:opsz in Core Text. When both are applied, font-variation-settings is supposed to win. However, in Core Text, kCTFontOpticalSizeAttribute wins. The solution for this is to set kCTFontOpticalSizeAttribute to a specific size, given by font-variation-settings:opsz. This should only happen when OpticalSizingTypes::Everything is enabled, so this patch adds an optional<float> to that struct. All this is guarded by a USE() so we can remove it if/when Core text changes to match the CSS behavior. Test: fast/text/variations/optical-sizing-optimizeLegibility.html * Source/WTF/wtf/PlatformUse.h: * Source/WebCore/platform/graphics/FontTaggedSettings.h: * Source/WebCore/platform/graphics/cocoa/UnrealizedCoreTextFont.cpp: (WebCore::UnrealizedCoreTextFont::addAttributesForOpticalSizing): (WebCore::UnrealizedCoreTextFont::modifyFromContext): * Source/WebCore/platform/graphics/cocoa/UnrealizedCoreTextFont.h: Canonical link: https://commits.webkit.org/262831@main
bcd51a2
to
8bbfbb1
Compare
Committed 262831@main (8bbfbb1): https://commits.webkit.org/262831@main Reviewed commits have been landed. Closing PR #12301 and removing active labels. |
8bbfbb1
bcd51a2
🧪 gtk-wk2🛠 🧪 jsc🧪 mac-wk2🧪 mac-AS-debug-wk2