mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
bug 1015603 part 3 - add a smallCaps field to gfxFontStyle, and pass it through from layout when creating gfxFontStyle records. r=roc
This commit is contained in:
parent
3721023208
commit
1be74705a6
@ -2313,6 +2313,7 @@ CanvasRenderingContext2D::SetFont(const nsAString& font,
|
||||
fontStyle->mFont.sizeAdjust,
|
||||
fontStyle->mFont.systemFont,
|
||||
printerFont,
|
||||
fontStyle->mFont.variant == NS_STYLE_FONT_VARIANT_SMALL_CAPS,
|
||||
fontStyle->mFont.languageOverride);
|
||||
|
||||
fontStyle->mFont.AddFontFeaturesToStyle(&style);
|
||||
|
@ -115,6 +115,7 @@ bool nsFont::BaseEquals(const nsFont& aOther) const
|
||||
(synthesis == aOther.synthesis) &&
|
||||
(fontFeatureSettings == aOther.fontFeatureSettings) &&
|
||||
(languageOverride == aOther.languageOverride) &&
|
||||
(variant == aOther.variant) &&
|
||||
(variantAlternates == aOther.variantAlternates) &&
|
||||
(variantCaps == aOther.variantCaps) &&
|
||||
(variantEastAsian == aOther.variantEastAsian) &&
|
||||
@ -132,7 +133,6 @@ bool nsFont::BaseEquals(const nsFont& aOther) const
|
||||
bool nsFont::Equals(const nsFont& aOther) const
|
||||
{
|
||||
if (BaseEquals(aOther) &&
|
||||
(variant == aOther.variant) &&
|
||||
(decorations == aOther.decorations)) {
|
||||
return true;
|
||||
}
|
||||
|
@ -122,6 +122,7 @@ nsFontMetrics::Init(const nsFont& aFont, nsIAtom* aLanguage,
|
||||
aFont.sizeAdjust,
|
||||
aFont.systemFont,
|
||||
mDeviceContext->IsPrinterSurface(),
|
||||
aFont.variant == NS_STYLE_FONT_VARIANT_SMALL_CAPS,
|
||||
aFont.languageOverride);
|
||||
|
||||
aFont.AddFontFeaturesToStyle(&style);
|
||||
|
@ -5981,6 +5981,7 @@ gfxFontStyle::gfxFontStyle() :
|
||||
languageOverride(NO_FONT_LANGUAGE_OVERRIDE),
|
||||
weight(NS_FONT_WEIGHT_NORMAL), stretch(NS_FONT_STRETCH_NORMAL),
|
||||
systemFont(true), printerFont(false), useGrayscaleAntialiasing(false),
|
||||
smallCaps(false),
|
||||
style(NS_FONT_STYLE_NORMAL)
|
||||
{
|
||||
}
|
||||
@ -5988,14 +5989,16 @@ gfxFontStyle::gfxFontStyle() :
|
||||
gfxFontStyle::gfxFontStyle(uint8_t aStyle, uint16_t aWeight, int16_t aStretch,
|
||||
gfxFloat aSize, nsIAtom *aLanguage,
|
||||
float aSizeAdjust, bool aSystemFont,
|
||||
bool aPrinterFont,
|
||||
bool aPrinterFont, bool aSmallCaps,
|
||||
const nsString& aLanguageOverride):
|
||||
language(aLanguage),
|
||||
size(aSize), sizeAdjust(aSizeAdjust),
|
||||
languageOverride(ParseFontLanguageOverride(aLanguageOverride)),
|
||||
weight(aWeight), stretch(aStretch),
|
||||
systemFont(aSystemFont), printerFont(aPrinterFont),
|
||||
useGrayscaleAntialiasing(false), style(aStyle)
|
||||
useGrayscaleAntialiasing(false),
|
||||
smallCaps(aSmallCaps),
|
||||
style(aStyle)
|
||||
{
|
||||
MOZ_ASSERT(!mozilla::IsNaN(size));
|
||||
MOZ_ASSERT(!mozilla::IsNaN(sizeAdjust));
|
||||
@ -6027,6 +6030,7 @@ gfxFontStyle::gfxFontStyle(const gfxFontStyle& aStyle) :
|
||||
weight(aStyle.weight), stretch(aStyle.stretch),
|
||||
systemFont(aStyle.systemFont), printerFont(aStyle.printerFont),
|
||||
useGrayscaleAntialiasing(aStyle.useGrayscaleAntialiasing),
|
||||
smallCaps(aStyle.smallCaps),
|
||||
style(aStyle.style)
|
||||
{
|
||||
featureSettings.AppendElements(aStyle.featureSettings);
|
||||
|
@ -74,7 +74,7 @@ struct gfxFontStyle {
|
||||
gfxFontStyle(uint8_t aStyle, uint16_t aWeight, int16_t aStretch,
|
||||
gfxFloat aSize, nsIAtom *aLanguage,
|
||||
float aSizeAdjust, bool aSystemFont,
|
||||
bool aPrinterFont,
|
||||
bool aPrinterFont, bool aSmallCaps,
|
||||
const nsString& aLanguageOverride);
|
||||
gfxFontStyle(const gfxFontStyle& aStyle);
|
||||
|
||||
@ -139,6 +139,10 @@ struct gfxFontStyle {
|
||||
// Used to imitate -webkit-font-smoothing: antialiased
|
||||
bool useGrayscaleAntialiasing : 1;
|
||||
|
||||
// Font should render as small-caps, using OT feature if available,
|
||||
// otherwise using a synthetic small-caps implementation
|
||||
bool smallCaps : 1;
|
||||
|
||||
// The style of font (normal, italic, oblique)
|
||||
uint8_t style : 2;
|
||||
|
||||
@ -163,6 +167,7 @@ struct gfxFontStyle {
|
||||
(*reinterpret_cast<const uint64_t*>(&size) ==
|
||||
*reinterpret_cast<const uint64_t*>(&other.size)) &&
|
||||
(style == other.style) &&
|
||||
(smallCaps == other.smallCaps) &&
|
||||
(systemFont == other.systemFont) &&
|
||||
(printerFont == other.printerFont) &&
|
||||
(useGrayscaleAntialiasing == other.useGrayscaleAntialiasing) &&
|
||||
|
Loading…
Reference in New Issue
Block a user