Title: [183673] trunk/Source/WebCore
Revision
183673
Author
[email protected]
Date
2015-05-01 09:00:13 -0700 (Fri, 01 May 2015)

Log 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.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (183672 => 183673)


--- trunk/Source/WebCore/ChangeLog	2015-05-01 14:58:19 UTC (rev 183672)
+++ trunk/Source/WebCore/ChangeLog	2015-05-01 16:00:13 UTC (rev 183673)
@@ -1,5 +1,19 @@
 2015-05-01  Martin Robinson  <[email protected]>
 
+        [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.
+
+2015-05-01  Martin Robinson  <[email protected]>
+
         [GTK] New CORS tests from r183280 fail on WebKitGTK+
         https://bugs.webkit.org/show_bug.cgi?id=144469
 

Modified: trunk/Source/WebCore/platform/graphics/freetype/FontPlatformDataFreeType.cpp (183672 => 183673)


--- trunk/Source/WebCore/platform/graphics/freetype/FontPlatformDataFreeType.cpp	2015-05-01 14:58:19 UTC (rev 183672)
+++ trunk/Source/WebCore/platform/graphics/freetype/FontPlatformDataFreeType.cpp	2015-05-01 16:00:13 UTC (rev 183673)
@@ -161,7 +161,8 @@
     if (FcPatternGetInteger(pattern, FC_SPACING, 0, &spacing) == FcResultMatch && spacing == FC_MONO)
         m_fixedWidth = true;
 
-    if (fontDescription.weight() >= FontWeightBold) {
+    bool descriptionAllowsSyntheticBold = fontDescription.fontSynthesis() & FontSynthesisWeight;
+    if (descriptionAllowsSyntheticBold && fontDescription.weight() >= FontWeightBold) {
         // The FC_EMBOLDEN property instructs us to fake the boldness of the font.
         FcBool fontConfigEmbolden = FcFalse;
         if (FcPatternGetBool(pattern, FC_EMBOLDEN, 0, &fontConfigEmbolden) == FcResultMatch)
@@ -327,8 +328,11 @@
 
     // We requested an italic font, but Fontconfig gave us one that was neither oblique nor italic.
     int actualFontSlant;
-    if (fontDescription.italic() && FcPatternGetInteger(optionsPattern, FC_SLANT, 0, &actualFontSlant) == FcResultMatch)
+    bool descriptionAllowsSyntheticOblique = fontDescription.fontSynthesis() & FontSynthesisStyle;
+    if (descriptionAllowsSyntheticOblique && fontDescription.italic()
+        && FcPatternGetInteger(optionsPattern, FC_SLANT, 0, &actualFontSlant) == FcResultMatch) {
         m_syntheticOblique = actualFontSlant == FC_SLANT_ROMAN;
+    }
 
     // The matrix from FontConfig does not include the scale. 
     cairo_matrix_scale(&fontMatrix, realSize, realSize);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to