Check for NULL familyName in SkFontMgr_fontconfig.

If the familyName is NULL, don't bother spending time trying to add
it to the FcPattern.

Review URL: https://codereview.chromium.org/1115073002
This commit is contained in:
bungeman 2015-04-29 14:35:49 -07:00 committed by Commit bot
parent 9954bc38c4
commit 6837b38a62

View File

@ -771,10 +771,12 @@ protected:
FCLocker lock; FCLocker lock;
SkAutoFcPattern pattern; SkAutoFcPattern pattern;
FcValue familyNameValue; if (familyName) {
familyNameValue.type = FcTypeString; FcValue familyNameValue;
familyNameValue.u.s = reinterpret_cast<const FcChar8*>(familyName); familyNameValue.type = FcTypeString;
FcPatternAddWeak(pattern, FC_FAMILY, familyNameValue, FcFalse); familyNameValue.u.s = reinterpret_cast<const FcChar8*>(familyName);
FcPatternAddWeak(pattern, FC_FAMILY, familyNameValue, FcFalse);
}
fcpattern_from_skfontstyle(style, pattern); fcpattern_from_skfontstyle(style, pattern);
SkAutoFcCharSet charSet; SkAutoFcCharSet charSet;