Commit 3ddd8411 authored by Allan Sandfeld Jensen's avatar Allan Sandfeld Jensen
Browse files

<third_party/WebKit> Fix webfonts with wrong hinting on Linux


This patch makes webfonts to read the fontconfig defaults for
their size and font style.

Change-Id: I80ffd8e2ff27d438c60457ca2b1836999e528783
Reviewed-by: default avatarJocelyn Turcotte <jocelyn.turcotte@digia.com>
No related merge requests found
Showing with 10 additions and 5 deletions
......@@ -141,9 +141,12 @@ void WebFontInfo::renderStyleForStrike(const char* family, int sizeAndStyle, Web
FcPattern* pattern = FcPatternCreate();
FcValue fcvalue;
fcvalue.type = FcTypeString;
fcvalue.u.s = reinterpret_cast<const FcChar8 *>(family);
FcPatternAdd(pattern, FC_FAMILY, fcvalue, FcFalse);
// A WebFont might not have family name yet, but we still want to pick up defaults for the size and style.
if (family && *family) {
fcvalue.type = FcTypeString;
fcvalue.u.s = reinterpret_cast<const FcChar8 *>(family);
FcPatternAdd(pattern, FC_FAMILY, fcvalue, FcFalse);
}
fcvalue.type = FcTypeInteger;
fcvalue.u.i = isBold ? FC_WEIGHT_BOLD : FC_WEIGHT_NORMAL;
......
......@@ -104,8 +104,10 @@ static inline void getRenderStyleForStrike(FontRenderStyle& fontRenderStyle, con
#if OS(ANDROID)
style.setDefaults();
#else
if (!font || !*font)
style.setDefaults(); // It's probably a webfont. Take the system defaults.
if (!font || !*font) {
// This is probably a webfont.
blink::WebFontInfo::renderStyleForStrike(font, sizeAndStyle, &style);
}
else if (blink::Platform::current()->sandboxSupport())
blink::Platform::current()->sandboxSupport()->getRenderStyleForStrike(font, sizeAndStyle, &style);
else
......
Supports Markdown
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