mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
bug 458634 part 2 - use 'smcp' feature in Graphite fonts if available. r=jdaggett
This commit is contained in:
parent
65d2b0d641
commit
4355cc9848
@ -123,6 +123,7 @@ gfxFontEntry::gfxFontEntry() :
|
||||
mHasSpaceFeaturesNonKerning(false),
|
||||
mSkipDefaultFeatureSpaceCheck(false),
|
||||
mCheckedForGraphiteTables(false),
|
||||
mCheckedForGraphiteSmallCaps(false),
|
||||
mHasCmapTable(false),
|
||||
mGrFaceInitialized(false),
|
||||
mCheckedForColorGlyph(false),
|
||||
@ -156,6 +157,7 @@ gfxFontEntry::gfxFontEntry(const nsAString& aName, bool aIsStandardFace) :
|
||||
mHasSpaceFeaturesNonKerning(false),
|
||||
mSkipDefaultFeatureSpaceCheck(false),
|
||||
mCheckedForGraphiteTables(false),
|
||||
mCheckedForGraphiteSmallCaps(false),
|
||||
mHasCmapTable(false),
|
||||
mGrFaceInitialized(false),
|
||||
mCheckedForColorGlyph(false),
|
||||
@ -949,6 +951,19 @@ gfxFontEntry::SupportsOpenTypeSmallCaps(int32_t aScript)
|
||||
return result;
|
||||
}
|
||||
|
||||
bool
|
||||
gfxFontEntry::SupportsGraphiteSmallCaps()
|
||||
{
|
||||
if (!mCheckedForGraphiteSmallCaps) {
|
||||
gr_face* face = GetGrFace();
|
||||
mHasGraphiteSmallCaps =
|
||||
gr_face_find_fref(face, TRUETYPE_TAG('s','m','c','p')) != nullptr;
|
||||
ReleaseGrFace(face);
|
||||
mCheckedForGraphiteSmallCaps = true;
|
||||
}
|
||||
return mHasGraphiteSmallCaps;
|
||||
}
|
||||
|
||||
bool
|
||||
gfxFontEntry::GetColorLayersInfo(uint32_t aGlyphId,
|
||||
nsTArray<uint16_t>& aLayerGlyphs,
|
||||
@ -2687,8 +2702,7 @@ bool
|
||||
gfxFont::SupportsSmallCaps(int32_t aScript)
|
||||
{
|
||||
if (mGraphiteShaper && gfxPlatform::GetPlatform()->UseGraphiteShaping()) {
|
||||
// we don't currently support real small caps via graphite
|
||||
return false;
|
||||
return GetFontEntry()->SupportsGraphiteSmallCaps();
|
||||
}
|
||||
|
||||
return GetFontEntry()->SupportsOpenTypeSmallCaps(aScript);
|
||||
|
@ -274,6 +274,7 @@ public:
|
||||
bool IgnoreGSUB() const { return mIgnoreGSUB; }
|
||||
|
||||
bool SupportsOpenTypeSmallCaps(int32_t aScript);
|
||||
bool SupportsGraphiteSmallCaps();
|
||||
|
||||
virtual bool IsSymbolFont();
|
||||
|
||||
@ -543,6 +544,8 @@ public:
|
||||
bool mSkipDefaultFeatureSpaceCheck : 1;
|
||||
bool mHasGraphiteTables : 1;
|
||||
bool mCheckedForGraphiteTables : 1;
|
||||
bool mHasGraphiteSmallCaps : 1;
|
||||
bool mCheckedForGraphiteSmallCaps : 1;
|
||||
bool mHasCmapTable : 1;
|
||||
bool mGrFaceInitialized : 1;
|
||||
bool mCheckedForColorGlyph : 1;
|
||||
|
Loading…
Reference in New Issue
Block a user