Changeset 183673 in webkit


Ignore:
Timestamp:
May 1, 2015 9:00:13 AM (9 years ago)
Author:
Martin Robinson
Message:

[Freetype] Add support for the font-synthesis property
https://bugs.webkit.org/show_bug.cgi?id=144472

Reviewed by Sergio Villar Senin.

No new tests. This causes fast/css3-text/font-synthesis.html to pass
for WebKitGTK+.

  • platform/graphics/freetype/FontPlatformDataFreeType.cpp:

(WebCore::FontPlatformData::FontPlatformData): Only use synthetic bold when the font description allows it.
(WebCore::FontPlatformData::initializeWithFontFace): Ditto for synthetic oblique.

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r183672 r183673  
     12015-05-01  Martin Robinson  <mrobinson@igalia.com>
     2
     3        [Freetype] Add support for the font-synthesis property
     4        https://bugs.webkit.org/show_bug.cgi?id=144472
     5
     6        Reviewed by Sergio Villar Senin.
     7
     8        No new tests. This causes fast/css3-text/font-synthesis.html to pass
     9        for WebKitGTK+.
     10
     11        * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
     12        (WebCore::FontPlatformData::FontPlatformData): Only use synthetic bold when the font description allows it.
     13        (WebCore::FontPlatformData::initializeWithFontFace): Ditto for synthetic oblique.
     14
    1152015-05-01  Martin Robinson  <mrobinson@igalia.com>
    216
  • trunk/Source/WebCore/platform/graphics/freetype/FontPlatformDataFreeType.cpp

    r180675 r183673  
    162162        m_fixedWidth = true;
    163163
    164     if (fontDescription.weight() >= FontWeightBold) {
     164    bool descriptionAllowsSyntheticBold = fontDescription.fontSynthesis() & FontSynthesisWeight;
     165    if (descriptionAllowsSyntheticBold && fontDescription.weight() >= FontWeightBold) {
    165166        // The FC_EMBOLDEN property instructs us to fake the boldness of the font.
    166167        FcBool fontConfigEmbolden = FcFalse;
     
    328329    // We requested an italic font, but Fontconfig gave us one that was neither oblique nor italic.
    329330    int actualFontSlant;
    330     if (fontDescription.italic() && FcPatternGetInteger(optionsPattern, FC_SLANT, 0, &actualFontSlant) == FcResultMatch)
     331    bool descriptionAllowsSyntheticOblique = fontDescription.fontSynthesis() & FontSynthesisStyle;
     332    if (descriptionAllowsSyntheticOblique && fontDescription.italic()
     333        && FcPatternGetInteger(optionsPattern, FC_SLANT, 0, &actualFontSlant) == FcResultMatch) {
    331334        m_syntheticOblique = actualFontSlant == FC_SLANT_ROMAN;
     335    }
    332336
    333337    // The matrix from FontConfig does not include the scale.
Note: See TracChangeset for help on using the changeset viewer.