Commit 00d728d8 authored by Dominik Röttsches's avatar Dominik Röttsches Committed by Commit Bot

Always apply opsz variable font axis optical sizing

When font-optical-sizing: is set to auto (the default) do apply a value
to the opsz axis even if font-variation-settings is not explicitly
specified.

TEST: virtual/text-antialias/mac-system-ui-trak.html
Bug: 1005969
Change-Id: I4baf448c6bc465b98eda4cf2538f3ef48e9c5ef1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2020767
Commit-Queue: Ben Wagner <bungeman@chromium.org>
Reviewed-by: default avatarBen Wagner <bungeman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#735406}
parent 81a759c4
...@@ -148,7 +148,7 @@ std::unique_ptr<FontPlatformData> FontPlatformDataFromNSFont( ...@@ -148,7 +148,7 @@ std::unique_ptr<FontPlatformData> FontPlatformDataFromNSFont(
: 0; : 0;
// No variable font requested, return static font. // No variable font requested, return static font.
if (!valid_configured_axes) if (!valid_configured_axes && optical_sizing == kNoneOpticalSizing)
return make_typeface_fontplatformdata(); return make_typeface_fontplatformdata();
int existing_axes = typeface->getVariationDesignPosition(nullptr, 0); int existing_axes = typeface->getVariationDesignPosition(nullptr, 0);
...@@ -171,7 +171,7 @@ std::unique_ptr<FontPlatformData> FontPlatformDataFromNSFont( ...@@ -171,7 +171,7 @@ std::unique_ptr<FontPlatformData> FontPlatformDataFromNSFont(
for (auto& coordinate : coordinates_to_set) { for (auto& coordinate : coordinates_to_set) {
// Set opsz to font size but allow having it overriden by // Set opsz to font size but allow having it overriden by
// font-variation-settings in case it has 'opsz'. // font-variation-settings in case it has 'opsz'.
if (coordinate.axis == kOpszTag) { if (coordinate.axis == kOpszTag && optical_sizing == kAutoOpticalSizing) {
if (coordinate.value != SkFloatToScalar(size)) { if (coordinate.value != SkFloatToScalar(size)) {
coordinate.value = SkFloatToScalar(size); coordinate.value = SkFloatToScalar(size);
axes_reconfigured = true; axes_reconfigured = true;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment