Bug 961558 - remove smallCaps from gfxFontStyle. r=jfkthame

This commit is contained in:
John Daggett 2014-06-23 12:09:17 +09:00
parent 5cbb161acd
commit bec96141f3
5 changed files with 7 additions and 22 deletions

View File

@ -2325,7 +2325,6 @@ CanvasRenderingContext2D::SetFont(const nsAString& font,
fontStyle->mFont.sizeAdjust,
fontStyle->mFont.systemFont,
printerFont,
fontStyle->mFont.variant == NS_STYLE_FONT_VARIANT_SMALL_CAPS,
fontStyle->mFont.synthesis & NS_FONT_SYNTHESIS_WEIGHT,
fontStyle->mFont.synthesis & NS_FONT_SYNTHESIS_STYLE,
fontStyle->mFont.languageOverride);

View File

@ -123,7 +123,6 @@ nsFontMetrics::Init(const nsFont& aFont, nsIAtom* aLanguage,
aFont.sizeAdjust,
aFont.systemFont,
mDeviceContext->IsPrinterSurface(),
aFont.variant == NS_STYLE_FONT_VARIANT_SMALL_CAPS,
aFont.synthesis & NS_FONT_SYNTHESIS_WEIGHT,
aFont.synthesis & NS_FONT_SYNTHESIS_STYLE,
aFont.languageOverride);

View File

@ -2136,7 +2136,6 @@ gfxFontShaper::MergeFontFeatures(
if (styleRuleFeatures.IsEmpty() &&
aFontFeatures.IsEmpty() &&
!aDisableLigatures &&
!aStyle->smallCaps &&
aStyle->variantCaps == NS_FONT_VARIANT_CAPS_NORMAL &&
numAlts == 0) {
return false;
@ -5621,13 +5620,11 @@ gfxFontGroup::InitScriptRun(gfxContext *aContext,
bool syntheticLower = false;
bool syntheticUpper = false;
if (mStyle.smallCaps ||
mStyle.variantCaps != NS_FONT_VARIANT_CAPS_NORMAL) {
if (mStyle.variantCaps != NS_FONT_VARIANT_CAPS_NORMAL) {
needsFakeSmallCaps =
!matchedFont->SupportsVariantCaps(aRunScript,
(mStyle.smallCaps ? NS_FONT_VARIANT_CAPS_SMALLCAPS :
mStyle.variantCaps),
petiteToSmallCaps, syntheticLower, syntheticUpper);
mStyle.variantCaps, petiteToSmallCaps,
syntheticLower, syntheticUpper);
}
if (needsFakeSmallCaps) {
if (!matchedFont->InitFakeSmallCapsRun(aContext, aTextRun,
@ -5912,7 +5909,6 @@ gfxFont::GetSmallCapsFont()
{
gfxFontStyle style(*GetStyle());
style.size *= SMALL_CAPS_SCALE_FACTOR;
style.smallCaps = false;
style.variantCaps = NS_FONT_VARIANT_CAPS_NORMAL;
gfxFontEntry* fe = GetFontEntry();
bool needsBold = style.weight >= 600 && !fe->IsBold();
@ -6364,7 +6360,6 @@ gfxFontStyle::gfxFontStyle() :
systemFont(true), printerFont(false), useGrayscaleAntialiasing(false),
style(NS_FONT_STYLE_NORMAL),
allowSyntheticWeight(true), allowSyntheticStyle(true),
smallCaps(false),
variantCaps(NS_FONT_VARIANT_CAPS_NORMAL)
{
}
@ -6372,7 +6367,7 @@ gfxFontStyle::gfxFontStyle() :
gfxFontStyle::gfxFontStyle(uint8_t aStyle, uint16_t aWeight, int16_t aStretch,
gfxFloat aSize, nsIAtom *aLanguage,
float aSizeAdjust, bool aSystemFont,
bool aPrinterFont, bool aSmallCaps,
bool aPrinterFont,
bool aAllowWeightSynthesis,
bool aAllowStyleSynthesis,
const nsString& aLanguageOverride):
@ -6385,7 +6380,6 @@ gfxFontStyle::gfxFontStyle(uint8_t aStyle, uint16_t aWeight, int16_t aStretch,
style(aStyle),
allowSyntheticWeight(aAllowWeightSynthesis),
allowSyntheticStyle(aAllowStyleSynthesis),
smallCaps(aSmallCaps),
variantCaps(NS_FONT_VARIANT_CAPS_NORMAL)
{
MOZ_ASSERT(!mozilla::IsNaN(size));
@ -6421,7 +6415,6 @@ gfxFontStyle::gfxFontStyle(const gfxFontStyle& aStyle) :
style(aStyle.style),
allowSyntheticWeight(aStyle.allowSyntheticWeight),
allowSyntheticStyle(aStyle.allowSyntheticStyle),
smallCaps(aStyle.smallCaps),
variantCaps(aStyle.variantCaps)
{
featureSettings.AppendElements(aStyle.featureSettings);

View File

@ -77,7 +77,7 @@ struct gfxFontStyle {
gfxFontStyle(uint8_t aStyle, uint16_t aWeight, int16_t aStretch,
gfxFloat aSize, nsIAtom *aLanguage,
float aSizeAdjust, bool aSystemFont,
bool aPrinterFont, bool aSmallCaps,
bool aPrinterFont,
bool aWeightSynthesis, bool aStyleSynthesis,
const nsString& aLanguageOverride);
gfxFontStyle(const gfxFontStyle& aStyle);
@ -150,12 +150,7 @@ struct gfxFontStyle {
bool allowSyntheticWeight : 1;
bool allowSyntheticStyle : 1;
// font-variant small-caps? render with font feature or use synthetic
// xxx - this will be trimmed out once font-variant becomes a shorthand
bool smallCaps : 1;
// caps variant (small-caps, petite-caps, etc.)
// (note: once font features are enabled this will subsume the bool above)
uint8_t variantCaps;
// Return the final adjusted font size for the given aspect ratio.
@ -179,7 +174,6 @@ struct gfxFontStyle {
(*reinterpret_cast<const uint64_t*>(&size) ==
*reinterpret_cast<const uint64_t*>(&other.size)) &&
(style == other.style) &&
(smallCaps == other.smallCaps) &&
(variantCaps == other.variantCaps) &&
(allowSyntheticWeight == other.allowSyntheticWeight) &&
(allowSyntheticStyle == other.allowSyntheticStyle) &&
@ -1968,7 +1962,7 @@ public:
protected:
// Return a font that is a "clone" of this one, but reduced to 80% size
// (and with the smallCaps style set to false).
// (and with variantCaps set to normal).
// Default implementation relies on gfxFontEntry::CreateFontInstance;
// backends that don't implement that will need to override this and use
// an alternative technique. (gfxPangoFonts, I'm looking at you...)

View File

@ -1534,7 +1534,7 @@ gfxFcFont::GetSmallCapsFont()
{
gfxFontStyle style(*GetStyle());
style.size *= SMALL_CAPS_SCALE_FACTOR;
style.smallCaps = false;
style.variantCaps = NS_FONT_VARIANT_CAPS_NORMAL;
gfxFcFontEntry* fe = static_cast<gfxFcFontEntry*>(GetFontEntry());
nsRefPtr<gfxFont> font = gfxFontCache::GetCache()->Lookup(fe, &style);
if (font) {