Bug 1460858 - Fix serialization/deserialization of SlantStyle for the Android startupCache, to ensure proper styled face selection. r=jwatt

This commit is contained in:
Jonathan Kew 2018-05-17 14:44:37 +01:00
Родитель 76570152bf
Коммит 39f95c038d
2 изменённых файлов: 8 добавлений и 3 удалений

Просмотреть файл

@ -347,8 +347,9 @@ public:
return Oblique(angle);
}
// Not recognized as an oblique angle; maybe it's from a startup-cache
// created by an older version. Just treat it as 'normal'.
return Normal();
// created by an older version. The style field there used a simple 0/1
// for normal/italic respectively.
return aString[0] == '0' ? Normal() : Italic();
}
}

Просмотреть файл

@ -1060,7 +1060,11 @@ AppendToFaceList(nsCString& aFaceList,
aFaceList.Append(',');
aFaceList.AppendInt(aFontEntry->mFTFontIndex);
aFaceList.Append(',');
aFaceList.Append(aFontEntry->IsItalic() ? '1' : '0');
// Note that ToString() appends to the destination string without
// replacing existing contents (see FontPropertyTypes.h)
aFontEntry->SlantStyle().Min().ToString(aFaceList);
aFaceList.Append(':');
aFontEntry->SlantStyle().Max().ToString(aFaceList);
aFaceList.Append(',');
aFaceList.AppendFloat(aFontEntry->Weight().Min().ToFloat());
aFaceList.Append(':');