mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-20 07:17:32 +09:00
Issue #2191 - Require implementation of gfxFont::GetScaledFont and remove unnecessary gfxPlatform::GetScaledFontForFont.
Backported from Mozilla bug 1385029.
This commit is contained in:
parent
b721b6257f
commit
0f7750cd27
17 changed files with 90 additions and 135 deletions
|
|
@ -22,6 +22,7 @@
|
|||
#define ROUND(x) floor((x) + 0.5)
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace mozilla::gfx;
|
||||
using namespace mozilla::unicode;
|
||||
|
||||
static inline cairo_antialias_t
|
||||
|
|
@ -130,6 +131,26 @@ gfxGDIFont::SetupCairoFont(DrawTarget* aDrawTarget)
|
|||
return true;
|
||||
}
|
||||
|
||||
already_AddRefed<ScaledFont>
|
||||
gfxGDIFont::GetScaledFont(DrawTarget *aTarget)
|
||||
{
|
||||
if (!mAzureScaledFont) {
|
||||
NativeFont nativeFont;
|
||||
nativeFont.mType = NativeFontType::GDI_FONT_FACE;
|
||||
LOGFONT lf;
|
||||
GetObject(GetHFONT(), sizeof(LOGFONT), &lf);
|
||||
nativeFont.mFont = &lf;
|
||||
|
||||
mAzureScaledFont =
|
||||
Factory::CreateScaledFontWithCairo(nativeFont,
|
||||
GetAdjustedSize(),
|
||||
GetCairoScaledFont());
|
||||
}
|
||||
|
||||
RefPtr<ScaledFont> scaledFont(mAzureScaledFont);
|
||||
return scaledFont.forget();
|
||||
}
|
||||
|
||||
gfxFont::RunMetrics
|
||||
gfxGDIFont::Measure(const gfxTextRun *aTextRun,
|
||||
uint32_t aStart, uint32_t aEnd,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue