mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1185812 - rejigger the ordering of fonts within a family to avoid obscure faces. r=heycam
This commit is contained in:
parent
3950ef30da
commit
e61be5512b
@ -1338,9 +1338,9 @@ gfxFontFamily::FindAllFontsForStyle(const gfxFontStyle& aFontStyle,
|
||||
|
||||
uint32_t minDistance = 0xffffffff;
|
||||
gfxFontEntry* matched = nullptr;
|
||||
// iterate in reverse order so that the last-defined font is the first one
|
||||
// in the fontlist used for matching, as per CSS Fonts spec
|
||||
for (int32_t i = count - 1; i >= 0; i--) {
|
||||
// iterate in forward order so that faces like 'Bold' are matched before
|
||||
// matching style distance faces such as 'Bold Outline' (see bug 1185812)
|
||||
for (uint32_t i = 0; i < count; i++) {
|
||||
fe = mAvailableFonts[i];
|
||||
uint32_t distance =
|
||||
WeightDistance(aFontStyle.weight, fe->Weight()) +
|
||||
|
@ -140,7 +140,9 @@ public:
|
||||
nsRefPtr<gfxFontEntry> fe = aFontEntry;
|
||||
// remove existing entry, if already present
|
||||
mAvailableFonts.RemoveElement(aFontEntry);
|
||||
mAvailableFonts.AppendElement(aFontEntry);
|
||||
// insert at the beginning so that the last-defined font is the first
|
||||
// one in the fontlist used for matching, as per CSS Fonts spec
|
||||
mAvailableFonts.InsertElementAt(0, aFontEntry);
|
||||
|
||||
if (aFontEntry->mFamilyName.IsEmpty()) {
|
||||
aFontEntry->mFamilyName = Name();
|
||||
|
Loading…
Reference in New Issue
Block a user