mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 761895; Fixed Azure/Cairo canvas font support on gtk and android. r=karl
This commit is contained in:
parent
84e07e74a9
commit
261a342f09
@ -261,7 +261,9 @@ Factory::CreateScaledFontForNativeFont(const NativeFont &aNativeFont, Float aSiz
|
||||
#ifdef USE_CAIRO
|
||||
case NATIVE_FONT_CAIRO_FONT_FACE:
|
||||
{
|
||||
return new ScaledFontBase(aSize);
|
||||
ScaledFontBase* fontBase = new ScaledFontBase(aSize);
|
||||
fontBase->SetCairoScaledFont(static_cast<cairo_scaled_font_t*>(aNativeFont.mFont));
|
||||
return fontBase;
|
||||
}
|
||||
#endif
|
||||
default:
|
||||
|
@ -163,14 +163,17 @@ gfxAndroidPlatform::MakePlatformFont(const gfxProxyFontEntry *aProxyEntry,
|
||||
RefPtr<ScaledFont>
|
||||
gfxAndroidPlatform::GetScaledFontForFont(DrawTarget* aTarget, gfxFont *aFont)
|
||||
{
|
||||
NS_ASSERTION(aFont->GetType() == gfxFont::FONT_TYPE_FT2, "Expecting Freetype font");
|
||||
NativeFont nativeFont;
|
||||
if (aTarget->GetType() == BACKEND_CAIRO) {
|
||||
nativeFont.mType = NATIVE_FONT_CAIRO_FONT_FACE;
|
||||
nativeFont.mFont = NULL;
|
||||
return Factory::CreateScaledFontWithCairo(nativeFont, aFont->GetAdjustedSize(), aFont->GetCairoScaledFont());
|
||||
}
|
||||
|
||||
NS_ASSERTION(aFont->GetType() == gfxFont::FONT_TYPE_FT2, "Expecting Freetype font");
|
||||
nativeFont.mType = NATIVE_FONT_SKIA_FONT_FACE;
|
||||
nativeFont.mFont = static_cast<gfxFT2FontBase*>(aFont)->GetFontOptions();
|
||||
RefPtr<ScaledFont> scaledFont =
|
||||
Factory::CreateScaledFontForNativeFont(nativeFont, aFont->GetAdjustedSize());
|
||||
|
||||
return scaledFont;
|
||||
return Factory::CreateScaledFontForNativeFont(nativeFont, aFont->GetAdjustedSize());
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -1547,7 +1547,8 @@ public:
|
||||
FONT_TYPE_GDI,
|
||||
FONT_TYPE_FT2,
|
||||
FONT_TYPE_MAC,
|
||||
FONT_TYPE_OS2
|
||||
FONT_TYPE_OS2,
|
||||
FONT_TYPE_CAIRO
|
||||
} FontType;
|
||||
|
||||
virtual FontType GetType() const = 0;
|
||||
|
@ -606,7 +606,7 @@ gfxPlatform::GetScaledFontForFont(DrawTarget* aTarget, gfxFont *aFont)
|
||||
{
|
||||
NativeFont nativeFont;
|
||||
nativeFont.mType = NATIVE_FONT_CAIRO_FONT_FACE;
|
||||
nativeFont.mFont = aFont;
|
||||
nativeFont.mFont = aFont->GetCairoScaledFont();
|
||||
RefPtr<ScaledFont> scaledFont =
|
||||
Factory::CreateScaledFontForNativeFont(nativeFont,
|
||||
aFont->GetAdjustedSize());
|
||||
|
@ -732,14 +732,16 @@ gfxPlatformGtk::GetGdkDrawable(gfxASurface *target)
|
||||
RefPtr<ScaledFont>
|
||||
gfxPlatformGtk::GetScaledFontForFont(DrawTarget* aTarget, gfxFont *aFont)
|
||||
{
|
||||
NS_ASSERTION(aFont->GetType() == gfxFont::FONT_TYPE_FT2, "Expecting Freetype font");
|
||||
NativeFont nativeFont;
|
||||
if (aTarget->GetType() == BACKEND_CAIRO) {
|
||||
nativeFont.mType = NATIVE_FONT_CAIRO_FONT_FACE;
|
||||
nativeFont.mFont = NULL;
|
||||
return Factory::CreateScaledFontWithCairo(nativeFont, aFont->GetAdjustedSize(), aFont->GetCairoScaledFont());
|
||||
}
|
||||
NS_ASSERTION(aFont->GetType() == gfxFont::FONT_TYPE_FT2, "Expecting Freetype font");
|
||||
nativeFont.mType = NATIVE_FONT_SKIA_FONT_FACE;
|
||||
nativeFont.mFont = static_cast<gfxFT2FontBase*>(aFont)->GetFontOptions();
|
||||
RefPtr<ScaledFont> scaledFont =
|
||||
Factory::CreateScaledFontForNativeFont(nativeFont, aFont->GetAdjustedSize());
|
||||
|
||||
return scaledFont;
|
||||
return Factory::CreateScaledFontForNativeFont(nativeFont, aFont->GetAdjustedSize());
|
||||
}
|
||||
|
||||
bool
|
||||
|
Loading…
Reference in New Issue
Block a user