Lines 1549-1568
gfxFcPlatformFontList::FindGenericFamili
Link Here
|
1549 |
NS_ConvertUTF8toUTF16 mappedGenericName(ToCharPtr(mappedGeneric)); |
1549 |
NS_ConvertUTF8toUTF16 mappedGenericName(ToCharPtr(mappedGeneric)); |
1550 |
gfxFontFamily* genericFamily = |
1550 |
gfxFontFamily* genericFamily = |
1551 |
gfxPlatformFontList::FindFamily(mappedGenericName); |
1551 |
gfxPlatformFontList::FindFamily(mappedGenericName); |
1552 |
if (genericFamily && !prefFonts->Contains(genericFamily)) { |
1552 |
if (genericFamily && !prefFonts->Contains(genericFamily)) { |
1553 |
prefFonts->AppendElement(genericFamily); |
1553 |
prefFonts->AppendElement(genericFamily); |
1554 |
bool foundLang = !fcLang.IsEmpty() && |
1554 |
bool foundLang = !fcLang.IsEmpty() && |
1555 |
PatternHasLang(font, ToFcChar8Ptr(fcLang.get())); |
1555 |
PatternHasLang(font, ToFcChar8Ptr(fcLang.get())); |
1556 |
foundFontWithLang = foundFontWithLang || foundLang; |
1556 |
foundFontWithLang = foundFontWithLang || foundLang; |
1557 |
// stop at the first family for which the lang matches (or |
1557 |
// check to see if the list is full |
1558 |
// when there is no lang) |
1558 |
if (prefFonts->Length() >= limit) { |
1559 |
if (fcLang.IsEmpty() || |
|
|
1560 |
prefFonts->Length() >= limit || foundLang) { |
1561 |
break; |
1559 |
break; |
1562 |
} |
1560 |
} |
1563 |
} |
1561 |
} |
1564 |
} |
1562 |
} |
1565 |
} |
1563 |
} |
1566 |
|
1564 |
|
1567 |
// if no font in the list matches the lang, trim all but the first one |
1565 |
// if no font in the list matches the lang, trim all but the first one |
1568 |
if (!prefFonts->IsEmpty() && !foundFontWithLang) { |
1566 |
if (!prefFonts->IsEmpty() && !foundFontWithLang) { |