mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 792207 - Part 3: Add UserData to ScaledFont. r=jrmuizel
This commit is contained in:
parent
97f01fd610
commit
8cf02dc4f8
@ -476,8 +476,17 @@ public:
|
||||
|
||||
virtual bool GetFontFileData(FontFileDataOutput, void *) { return false; }
|
||||
|
||||
void AddUserData(UserDataKey *key, void *userData, void (*destroy)(void*)) {
|
||||
mUserData.Add(key, userData, destroy);
|
||||
}
|
||||
void *GetUserData(UserDataKey *key) {
|
||||
return mUserData.Get(key);
|
||||
}
|
||||
|
||||
protected:
|
||||
ScaledFont() {}
|
||||
|
||||
UserData mUserData;
|
||||
};
|
||||
|
||||
#ifdef MOZ_ENABLE_FREETYPE
|
||||
|
@ -284,6 +284,24 @@ Factory::CreateScaledFontForNativeFont(const NativeFont &aNativeFont, Float aSiz
|
||||
}
|
||||
}
|
||||
|
||||
TemporaryRef<ScaledFont>
|
||||
Factory::CreateScaledFontForTrueTypeData(uint8_t *aData, uint32_t aSize,
|
||||
uint32_t aFaceIndex, Float aGlyphSize,
|
||||
FontType aType)
|
||||
{
|
||||
switch (aType) {
|
||||
#ifdef WIN32
|
||||
case FONT_DWRITE:
|
||||
{
|
||||
return new ScaledFontDWrite(aData, aSize, aFaceIndex, aGlyphSize);
|
||||
}
|
||||
#endif
|
||||
default:
|
||||
gfxWarning() << "Unable to create requested font type from truetype data";
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
TemporaryRef<ScaledFont>
|
||||
Factory::CreateScaledFontWithCairo(const NativeFont& aNativeFont, Float aSize, cairo_scaled_font_t* aScaledFont)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user