зеркало из https://github.com/mozilla/gecko-dev.git
Bug 507970, part 3: add @font-face format hint for woff fonts, r=jdaggett
--HG-- extra : rebase_source : 44bbd8455cffbd21d77fafdec21e1a80792cd6d7
This commit is contained in:
Родитель
37bbb8bf3d
Коммит
e9ea75cd3f
|
@ -152,9 +152,10 @@ public:
|
|||
FLAG_FORMAT_TRUETYPE_AAT = 1 << 3,
|
||||
FLAG_FORMAT_EOT = 1 << 4,
|
||||
FLAG_FORMAT_SVG = 1 << 5,
|
||||
|
||||
FLAG_FORMAT_WOFF = 1 << 6,
|
||||
|
||||
// mask of all unused bits, update when adding new formats
|
||||
FLAG_FORMAT_NOT_USED = ~((1 << 6)-1)
|
||||
FLAG_FORMAT_NOT_USED = ~((1 << 7)-1)
|
||||
};
|
||||
|
||||
enum LoadStatus {
|
||||
|
|
|
@ -326,7 +326,8 @@ gfxPlatformGtk::IsFontFormatSupported(nsIURI *aFontURI, PRUint32 aFormatFlags)
|
|||
// Pango doesn't apply features from AAT TrueType extensions.
|
||||
// Assume that if this is the only SFNT format specified,
|
||||
// then AAT extensions are required for complex script support.
|
||||
if (aFormatFlags & (gfxUserFontSet::FLAG_FORMAT_OPENTYPE |
|
||||
if (aFormatFlags & (gfxUserFontSet::FLAG_FORMAT_WOFF |
|
||||
gfxUserFontSet::FLAG_FORMAT_OPENTYPE |
|
||||
gfxUserFontSet::FLAG_FORMAT_TRUETYPE)) {
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
|
|
@ -207,7 +207,8 @@ gfxPlatformMac::IsFontFormatSupported(nsIURI *aFontURI, PRUint32 aFormatFlags)
|
|||
"strange font format hint set");
|
||||
|
||||
// accept supported formats
|
||||
if (aFormatFlags & (gfxUserFontSet::FLAG_FORMAT_OPENTYPE |
|
||||
if (aFormatFlags & (gfxUserFontSet::FLAG_FORMAT_WOFF |
|
||||
gfxUserFontSet::FLAG_FORMAT_OPENTYPE |
|
||||
gfxUserFontSet::FLAG_FORMAT_TRUETYPE |
|
||||
gfxUserFontSet::FLAG_FORMAT_TRUETYPE_AAT)) {
|
||||
return PR_TRUE;
|
||||
|
|
|
@ -864,7 +864,8 @@ gfxWindowsPlatform::IsFontFormatSupported(nsIURI *aFontURI, PRUint32 aFormatFlag
|
|||
"strange font format hint set");
|
||||
|
||||
// accept supported formats
|
||||
if (aFormatFlags & (gfxUserFontSet::FLAG_FORMAT_OPENTYPE |
|
||||
if (aFormatFlags & (gfxUserFontSet::FLAG_FORMAT_WOFF |
|
||||
gfxUserFontSet::FLAG_FORMAT_OPENTYPE |
|
||||
gfxUserFontSet::FLAG_FORMAT_TRUETYPE)) {
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
|
|
@ -1743,7 +1743,9 @@ InsertFontFaceRule(nsCSSFontFaceRule *aRule, gfxUserFontSet* aFontSet,
|
|||
while (i + 1 < numSrc && (val = srcArr->Item(i+1),
|
||||
val.GetUnit() == eCSSUnit_Font_Format)) {
|
||||
nsDependentString valueString(val.GetStringBufferValue());
|
||||
if (valueString.LowerCaseEqualsASCII("opentype")) {
|
||||
if (valueString.LowerCaseEqualsASCII("woff")) {
|
||||
face->mFormatFlags |= gfxUserFontSet::FLAG_FORMAT_WOFF;
|
||||
} else if (valueString.LowerCaseEqualsASCII("opentype")) {
|
||||
face->mFormatFlags |= gfxUserFontSet::FLAG_FORMAT_OPENTYPE;
|
||||
} else if (valueString.LowerCaseEqualsASCII("truetype")) {
|
||||
face->mFormatFlags |= gfxUserFontSet::FLAG_FORMAT_TRUETYPE;
|
||||
|
|
Загрузка…
Ссылка в новой задаче