Issue #2646 - Parse "variations" keywords.

Resolves #2646
This commit is contained in:
Moonchild 2024-10-29 11:16:30 +01:00 committed by roytam1
commit 8d536c0cc7
3 changed files with 32 additions and 2 deletions

View file

@ -1132,6 +1132,15 @@ FontFaceSet::FindOrCreateUserFontEntryFromFontFace(const nsAString& aFamilyName,
face->mFormatFlags |= gfxUserFontSet::FLAG_FORMAT_EOT;
} else if (valueString.LowerCaseEqualsASCII("svg")) {
face->mFormatFlags |= gfxUserFontSet::FLAG_FORMAT_SVG;
} else if (valueString.LowerCaseEqualsASCII("woff-variations")) {
face->mFormatFlags |= gfxUserFontSet::FLAG_FORMAT_WOFF_VARIATIONS;
} else if (Preferences::GetBool(GFX_PREF_WOFF2_ENABLED) &&
valueString.LowerCaseEqualsASCII("woff2-variations")) {
face->mFormatFlags |= gfxUserFontSet::FLAG_FORMAT_WOFF2_VARIATIONS;
} else if (valueString.LowerCaseEqualsASCII("opentype-variations")) {
face->mFormatFlags |= gfxUserFontSet::FLAG_FORMAT_OPENTYPE_VARIATIONS;
} else if (valueString.LowerCaseEqualsASCII("truetype-variations")) {
face->mFormatFlags |= gfxUserFontSet::FLAG_FORMAT_TRUETYPE_VARIATIONS;
} else {
// unknown format specified, mark to distinguish from the
// case where no format hints are specified