Index: src/ports/SkFontConfigInterface_android.cpp |
diff --git a/src/ports/SkFontConfigInterface_android.cpp b/src/ports/SkFontConfigInterface_android.cpp |
index 1651ac9c05eaf4694d82686b7148ad1d43212657..af0c0ebdbe1ffd9876723365a2323aa80f95e94b 100644 |
--- a/src/ports/SkFontConfigInterface_android.cpp |
+++ b/src/ports/SkFontConfigInterface_android.cpp |
@@ -69,7 +69,8 @@ struct FamilyRec { |
FontRecID fFontRecID[FONT_STYLE_COUNT]; |
bool fIsFallbackFont; |
SkString fFallbackName; |
- SkPaintOptionsAndroid fPaintOptions; |
+ SkLanguage fLanguage; |
+ FontVariant fVariant; |
}; |
@@ -252,12 +253,8 @@ SkFontConfigInterfaceAndroid::SkFontConfigInterfaceAndroid(SkTDArray<FontFamily* |
fontRec.fFamilyRecID = familyRecID; |
familyRec->fIsFallbackFont = family->fIsFallbackFont; |
- familyRec->fPaintOptions = family->fFontFiles[j].fPaintOptions; |
- |
- } else if (familyRec->fPaintOptions != family->fFontFiles[j].fPaintOptions) { |
- SkDebugf("Every font file within a family must have identical" |
- "language and variant attributes"); |
- sk_throw(); |
+ familyRec->fLanguage = family->fLanguage; |
+ familyRec->fVariant = family->fVariant; |
} |
// add this font to the current familyRec |
@@ -305,7 +302,7 @@ SkFontConfigInterfaceAndroid::SkFontConfigInterfaceAndroid(SkTDArray<FontFamily* |
while(fallbackLang != NULL) { |
for (int i = 0; i < fDefaultFallbackList.count(); i++) { |
FamilyRecID familyRecID = fDefaultFallbackList[i]; |
- const SkString& fontLang = fFontFamilies[familyRecID].fPaintOptions.getLanguage().getTag(); |
+ const SkString& fontLang = fFontFamilies[familyRecID].fLanguage.getTag(); |
if (strcmp(fallbackLang, fontLang.c_str()) != 0) { |
fallbackList->push(familyRecID); |
} |
@@ -340,7 +337,7 @@ void SkFontConfigInterfaceAndroid::addFallbackFamily(FamilyRecID familyRecID) { |
fDefaultFallbackList.push(familyRecID); |
// stop here if it is the default language tag |
- const SkString& languageTag = familyRec.fPaintOptions.getLanguage().getTag(); |
+ const SkString& languageTag = familyRec.fLanguage.getTag(); |
if (languageTag.isEmpty()) { |
return; |
} |
@@ -511,9 +508,9 @@ bool SkFontConfigInterfaceAndroid::getFallbackFamilyNameForChar(SkUnichar uni, |
FamilyRecID familyRecID = fallbackFontList->getAt(i); |
// if it is not one of the accepted variants then move to the next family |
- int32_t acceptedVariants = SkPaintOptionsAndroid::kDefault_Variant | |
- SkPaintOptionsAndroid::kElegant_Variant; |
- if (!(fFontFamilies[familyRecID].fPaintOptions.getFontVariant() & acceptedVariants)) { |
+ int32_t acceptedVariants = kDefault_FontVariant | |
+ kElegant_FontVariant; |
+ if (!(fFontFamilies[familyRecID].fVariant & acceptedVariants)) { |
continue; |
} |