Changeset 223589 in webkit


Ignore:
Timestamp:
Oct 17, 2017 5:34:23 PM (7 years ago)
Author:
mmaxfield@apple.com
Message:

[Regression] Webkit "-apple-system" font fallback token handles font weights of PingFang incorrectly.
https://bugs.webkit.org/show_bug.cgi?id=177345
<rdar://problem/32975942>

Reviewed by Jon Lee.

Source/WebCore:

This bug has a fairly insideous cause. In particular, the system font fallback path follows
system conventions, which are not the same as the CSS fallback path. For example, the Chinese
fallback of San Francisco weight 600 is Ping Fang weight 500. This doesn't match our
assumptions in CSS, because Ping Fang does have a 600 weight, which CSS would think is closer.
However, the whole point of system-ui is that it follows the system fallback path, not CSS's.
Therefore, falling back from a bold system-ui request to a non-bold fallback font is correct
and expected, and we shouldn't synthesize bold in this situation.

Test: fast/text/system-ui-chinese-bold-fallback.html

  • platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp:

(WebCore::FontFamilySpecificationCoreText::fontRanges const):

LayoutTests:

  • fast/text/system-ui-chinese-bold-fallback.html:
Location:
trunk
Files:
4 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r223587 r223589  
     12017-10-17  Myles C. Maxfield  <mmaxfield@apple.com>
     2
     3        [Regression] Webkit "-apple-system" font fallback token handles font weights of PingFang incorrectly.
     4        https://bugs.webkit.org/show_bug.cgi?id=177345
     5        <rdar://problem/32975942>
     6
     7        Reviewed by Jon Lee.
     8
     9        * fast/text/system-ui-chinese-bold-fallback.html:
     10
    1112017-10-17  Dean Jackson  <dino@apple.com>
    212
  • trunk/Source/WebCore/ChangeLog

    r223585 r223589  
     12017-10-17  Myles C. Maxfield  <mmaxfield@apple.com>
     2
     3        [Regression] Webkit "-apple-system" font fallback token handles font weights of PingFang incorrectly.
     4        https://bugs.webkit.org/show_bug.cgi?id=177345
     5        <rdar://problem/32975942>
     6
     7        Reviewed by Jon Lee.
     8
     9        This bug has a fairly insideous cause. In particular, the system font fallback path follows
     10        system conventions, which are not the same as the CSS fallback path. For example, the Chinese
     11        fallback of San Francisco weight 600 is Ping Fang weight 500. This doesn't match our
     12        assumptions in CSS, because Ping Fang does have a 600 weight, which CSS would think is closer.
     13        However, the whole point of system-ui is that it follows the system fallback path, not CSS's.
     14        Therefore, falling back from a bold system-ui request to a non-bold fallback font is correct
     15        and expected, and we shouldn't synthesize bold in this situation.
     16
     17        Test: fast/text/system-ui-chinese-bold-fallback.html
     18
     19        * platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp:
     20        (WebCore::FontFamilySpecificationCoreText::fontRanges const):
     21
    1222017-10-17  Chelsea Pugh  <cpugh@apple.com>
    223
  • trunk/Source/WebCore/platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp

    r221950 r223589  
    6161    std::tie(syntheticBold, syntheticOblique) = computeNecessarySynthesis(fontForSynthesisComputation.get(), fontDescription).boldObliquePair();
    6262
    63     FontPlatformData fontPlatformData(font.get(), size, syntheticBold, syntheticOblique, fontDescription.orientation(), fontDescription.widthVariant(), fontDescription.textRenderingMode());
     63    FontPlatformData fontPlatformData(font.get(), size, false, syntheticOblique, fontDescription.orientation(), fontDescription.widthVariant(), fontDescription.textRenderingMode());
    6464
    6565    return FontRanges(FontCache::singleton().fontForPlatformData(fontPlatformData));
Note: See TracChangeset for help on using the changeset viewer.