mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-27 15:55:16 +00:00
Bug 1373852 - Map font-kerning:normal to the appropriate low-level feature depending on orientation. r=jrmuizel
This commit is contained in:
parent
69e32ded2f
commit
30dd92d9f5
@ -166,13 +166,15 @@ FontFeatureTagForVariantWidth(uint32_t aVariantWidth)
|
||||
}
|
||||
}
|
||||
|
||||
void nsFont::AddFontFeaturesToStyle(gfxFontStyle *aStyle) const
|
||||
void nsFont::AddFontFeaturesToStyle(gfxFontStyle *aStyle,
|
||||
bool aVertical) const
|
||||
{
|
||||
// add in font-variant features
|
||||
gfxFontFeature setting;
|
||||
|
||||
// -- kerning
|
||||
setting.mTag = TRUETYPE_TAG('k','e','r','n');
|
||||
setting.mTag = aVertical ? TRUETYPE_TAG('v','k','r','n')
|
||||
: TRUETYPE_TAG('k','e','r','n');
|
||||
switch (kerning) {
|
||||
case NS_FONT_KERNING_NONE:
|
||||
setting.mValue = 0;
|
||||
|
@ -140,7 +140,8 @@ struct nsFont {
|
||||
void CopyAlternates(const nsFont& aOther);
|
||||
|
||||
// Add featureSettings into style
|
||||
void AddFontFeaturesToStyle(gfxFontStyle *aStyle) const;
|
||||
void AddFontFeaturesToStyle(gfxFontStyle *aStyle,
|
||||
bool aVertical) const;
|
||||
|
||||
void AddFontVariationsToStyle(gfxFontStyle *aStyle) const;
|
||||
};
|
||||
|
@ -134,7 +134,7 @@ nsFontMetrics::nsFontMetrics(const nsFont& aFont, const Params& aParams,
|
||||
aFont.synthesis & NS_FONT_SYNTHESIS_STYLE,
|
||||
aFont.languageOverride);
|
||||
|
||||
aFont.AddFontFeaturesToStyle(&style);
|
||||
aFont.AddFontFeaturesToStyle(&style, mOrientation == gfxFont::eVertical);
|
||||
aFont.AddFontVariationsToStyle(&style);
|
||||
|
||||
gfxFloat devToCssSize = gfxFloat(mP2A) /
|
||||
|
Loading…
x
Reference in New Issue
Block a user