Remove tracking of which font families are quirky, since we no longer use the information. (Bug 636040) r=jdaggett

This commit is contained in:
L. David Baron 2011-03-03 13:18:42 -08:00
parent efffd3fdc3
commit 4a7745e74d
11 changed files with 6 additions and 33 deletions

View File

@ -2320,7 +2320,6 @@ nsCanvasRenderingContext2D::SetFont(const nsAString& font)
language,
fontStyle->mFont.sizeAdjust,
fontStyle->mFont.systemFont,
fontStyle->mFont.familyNameQuirks,
printerFont,
fontStyle->mFont.featureSettings,
fontStyle->mFont.languageOverride);

View File

@ -52,7 +52,6 @@ nsFont::nsFont(const char* aName, PRUint8 aStyle, PRUint8 aVariant,
style = aStyle;
systemFont = PR_FALSE;
variant = aVariant;
familyNameQuirks = PR_FALSE;
weight = aWeight;
stretch = aStretch;
decorations = aDecoration;
@ -76,7 +75,6 @@ nsFont::nsFont(const nsString& aName, PRUint8 aStyle, PRUint8 aVariant,
style = aStyle;
systemFont = PR_FALSE;
variant = aVariant;
familyNameQuirks = PR_FALSE;
weight = aWeight;
stretch = aStretch;
decorations = aDecoration;
@ -96,7 +94,6 @@ nsFont::nsFont(const nsFont& aOther)
style = aOther.style;
systemFont = aOther.systemFont;
variant = aOther.variant;
familyNameQuirks = aOther.familyNameQuirks;
weight = aOther.weight;
stretch = aOther.stretch;
decorations = aOther.decorations;
@ -118,7 +115,6 @@ PRBool nsFont::BaseEquals(const nsFont& aOther) const
{
if ((style == aOther.style) &&
(systemFont == aOther.systemFont) &&
(familyNameQuirks == aOther.familyNameQuirks) &&
(weight == aOther.weight) &&
(stretch == aOther.stretch) &&
(size == aOther.size) &&
@ -147,7 +143,6 @@ nsFont& nsFont::operator=(const nsFont& aOther)
style = aOther.style;
systemFont = aOther.systemFont;
variant = aOther.variant;
familyNameQuirks = aOther.familyNameQuirks;
weight = aOther.weight;
stretch = aOther.stretch;
decorations = aOther.decorations;

View File

@ -78,10 +78,6 @@ struct NS_GFX nsFont {
// The variant of the font (normal, small-caps)
PRUint8 variant;
// True if the character set quirks (for treatment of "Symbol",
// "Wingdings", etc.) should be applied.
PRUint8 familyNameQuirks;
// The weight of the font; see gfxFontConstants.h.
PRUint16 weight;

View File

@ -831,7 +831,6 @@ nsThebesDeviceContext::GetSystemFont(nsSystemFontID aID, nsFont *aFont) const
aFont->style = fontStyle.style;
aFont->systemFont = fontStyle.systemFont;
aFont->variant = NS_FONT_VARIANT_NORMAL;
aFont->familyNameQuirks = fontStyle.familyNameQuirks;
aFont->weight = fontStyle.weight;
aFont->stretch = fontStyle.stretch;
aFont->decorations = NS_FONT_DECORATION_NONE;

View File

@ -82,7 +82,6 @@ nsThebesFontMetrics::Init(const nsFont& aFont, nsIAtom* aLanguage,
mFontStyle = new gfxFontStyle(aFont.style, aFont.weight, aFont.stretch,
size, aLanguage,
aFont.sizeAdjust, aFont.systemFont,
aFont.familyNameQuirks,
printerFont,
aFont.featureSettings,
aFont.languageOverride);

View File

@ -2860,7 +2860,7 @@ gfxFontStyle::ParseFontLanguageOverride(const nsString& aLangTag)
gfxFontStyle::gfxFontStyle() :
style(FONT_STYLE_NORMAL), systemFont(PR_TRUE), printerFont(PR_FALSE),
familyNameQuirks(PR_FALSE), weight(FONT_WEIGHT_NORMAL),
weight(FONT_WEIGHT_NORMAL),
stretch(NS_FONT_STRETCH_NORMAL), size(DEFAULT_PIXEL_FONT_SIZE),
sizeAdjust(0.0f),
language(gfxAtoms::x_western),
@ -2871,12 +2871,11 @@ gfxFontStyle::gfxFontStyle() :
gfxFontStyle::gfxFontStyle(PRUint8 aStyle, PRUint16 aWeight, PRInt16 aStretch,
gfxFloat aSize, nsIAtom *aLanguage,
float aSizeAdjust, PRPackedBool aSystemFont,
PRPackedBool aFamilyNameQuirks,
PRPackedBool aPrinterFont,
const nsString& aFeatureSettings,
const nsString& aLanguageOverride):
style(aStyle), systemFont(aSystemFont), printerFont(aPrinterFont),
familyNameQuirks(aFamilyNameQuirks), weight(aWeight), stretch(aStretch),
weight(aWeight), stretch(aStretch),
size(aSize), sizeAdjust(aSizeAdjust),
language(aLanguage),
languageOverride(ParseFontLanguageOverride(aLanguageOverride))
@ -2904,7 +2903,7 @@ gfxFontStyle::gfxFontStyle(PRUint8 aStyle, PRUint16 aWeight, PRInt16 aStretch,
gfxFontStyle::gfxFontStyle(const gfxFontStyle& aStyle) :
style(aStyle.style), systemFont(aStyle.systemFont), printerFont(aStyle.printerFont),
familyNameQuirks(aStyle.familyNameQuirks), weight(aStyle.weight),
weight(aStyle.weight),
stretch(aStyle.stretch), size(aStyle.size),
sizeAdjust(aStyle.sizeAdjust),
language(aStyle.language),

View File

@ -111,7 +111,6 @@ struct THEBES_API gfxFontStyle {
gfxFontStyle(PRUint8 aStyle, PRUint16 aWeight, PRInt16 aStretch,
gfxFloat aSize, nsIAtom *aLanguage,
float aSizeAdjust, PRPackedBool aSystemFont,
PRPackedBool aFamilyNameQuirks,
PRPackedBool aPrinterFont,
const nsString& aFeatureSettings,
const nsString& aLanguageOverride);
@ -128,10 +127,6 @@ struct THEBES_API gfxFontStyle {
// Say that this font is used for print or print preview.
PRPackedBool printerFont : 1;
// True if the character set quirks (for treatment of "Symbol",
// "Wingdings", etc.) should be applied.
PRPackedBool familyNameQuirks : 1;
// The weight of the font: 100, 200, ... 900.
PRUint16 weight;
@ -177,8 +172,8 @@ struct THEBES_API gfxFontStyle {
}
PLDHashNumber Hash() const {
return ((style + (systemFont << 7) + (familyNameQuirks << 8) +
(weight << 9)) + PRUint32(size*1000) + PRUint32(sizeAdjust*1000)) ^
return ((style + (systemFont << 7) +
(weight << 8)) + PRUint32(size*1000) + PRUint32(sizeAdjust*1000)) ^
nsISupportsHashKey::HashKey(language);
}
@ -189,7 +184,6 @@ struct THEBES_API gfxFontStyle {
(style == other.style) &&
(systemFont == other.systemFont) &&
(printerFont == other.printerFont) &&
(familyNameQuirks == other.familyNameQuirks) &&
(weight == other.weight) &&
(stretch == other.stretch) &&
(language == other.language) &&

View File

@ -2346,7 +2346,7 @@ gfxFcFont::GetOrMakeFont(FcPattern *aRequestedPattern, FcPattern *aFontPattern)
// FIXME: Pass a real stretch based on renderPattern!
gfxFontStyle fontStyle(style, weight, NS_FONT_STRETCH_NORMAL,
size, language, 0.0,
PR_TRUE, PR_FALSE, PR_FALSE,
PR_TRUE, PR_FALSE,
NS_LITERAL_STRING(""),
NS_LITERAL_STRING(""));

View File

@ -2944,9 +2944,6 @@ nsRuleNode::SetFont(nsPresContext* aPresContext, nsStyleContext* aContext,
// defaultVariableFont.name should always be "serif" or "sans-serif".
aFont->mFont.name.Append(defaultVariableFont->name);
}
aFont->mFont.familyNameQuirks =
(aPresContext->CompatibilityMode() == eCompatibility_NavQuirks &&
aFontData.mFamilyFromHTML);
aFont->mFont.systemFont = PR_FALSE;
// Technically this is redundant with the code below, but it's good
// to have since we'll still want it once we get rid of
@ -2955,20 +2952,17 @@ nsRuleNode::SetFont(nsPresContext* aPresContext, nsStyleContext* aContext,
}
else if (eCSSUnit_System_Font == aFontData.mFamily.GetUnit()) {
aFont->mFont.name = systemFont.name;
aFont->mFont.familyNameQuirks = PR_FALSE;
aFont->mFont.systemFont = PR_TRUE;
aFont->mGenericID = kGenericFont_NONE;
}
else if (eCSSUnit_Inherit == aFontData.mFamily.GetUnit()) {
aCanStoreInRuleTree = PR_FALSE;
aFont->mFont.name = aParentFont->mFont.name;
aFont->mFont.familyNameQuirks = aParentFont->mFont.familyNameQuirks;
aFont->mFont.systemFont = aParentFont->mFont.systemFont;
aFont->mGenericID = aParentFont->mGenericID;
}
else if (eCSSUnit_Initial == aFontData.mFamily.GetUnit()) {
aFont->mFont.name = defaultVariableFont->name;
aFont->mFont.familyNameQuirks = PR_FALSE;
aFont->mFont.systemFont = defaultVariableFont->systemFont;
aFont->mGenericID = kGenericFont_NONE;
}

View File

@ -208,7 +208,6 @@ nsChangeHint nsStyleFont::CalcFontDifference(const nsFont& aFont1, const nsFont&
(aFont1.sizeAdjust == aFont2.sizeAdjust) &&
(aFont1.style == aFont2.style) &&
(aFont1.variant == aFont2.variant) &&
(aFont1.familyNameQuirks == aFont2.familyNameQuirks) &&
(aFont1.weight == aFont2.weight) &&
(aFont1.stretch == aFont2.stretch) &&
(aFont1.name == aFont2.name) &&

View File

@ -1602,7 +1602,6 @@ nsSVGGlyphFrame::EnsureTextRun(float *aDrawScale, float *aMetricsScale,
gfxFontStyle fontStyle(font.style, font.weight, font.stretch, textRunSize,
mStyleContext->GetStyleVisibility()->mLanguage,
font.sizeAdjust, font.systemFont,
font.familyNameQuirks,
printerFont,
font.featureSettings,
font.languageOverride);