diff options
Diffstat (limited to 'Source/WebKit/chromium/src/linux/WebFontInfo.cpp')
-rw-r--r-- | Source/WebKit/chromium/src/linux/WebFontInfo.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/Source/WebKit/chromium/src/linux/WebFontInfo.cpp b/Source/WebKit/chromium/src/linux/WebFontInfo.cpp index b23b77789..327af40c9 100644 --- a/Source/WebKit/chromium/src/linux/WebFontInfo.cpp +++ b/Source/WebKit/chromium/src/linux/WebFontInfo.cpp @@ -39,6 +39,13 @@ namespace WebKit { +static bool useSubpixelPositioning = false; + +void WebFontInfo::setSubpixelPositioning(bool subpixelPositioning) +{ + useSubpixelPositioning = subpixelPositioning; +} + void WebFontInfo::familyForChars(const WebUChar* characters, size_t numCharacters, const char* preferredLocale, WebFontFamily* family) { FcCharSet* cset = FcCharSetCreate(); @@ -185,21 +192,25 @@ void WebFontInfo::renderStyleForStrike(const char* family, int sizeAndStyle, Web if (FcPatternGetInteger(match, FC_RGBA, 0, &i) == FcResultMatch) { switch (i) { case FC_RGBA_NONE: - out->useSubpixel = 0; + out->useSubpixelRendering = 0; break; case FC_RGBA_RGB: case FC_RGBA_BGR: case FC_RGBA_VRGB: case FC_RGBA_VBGR: - out->useSubpixel = 1; + out->useSubpixelRendering = 1; break; default: // This includes FC_RGBA_UNKNOWN. - out->useSubpixel = 2; + out->useSubpixelRendering = 2; break; } } + // FontConfig doesn't provide parameters to configure whether subpixel + // positioning should be used or not, so we just use a global setting. + out->useSubpixelPositioning = useSubpixelPositioning; + FcPatternDestroy(match); } |