mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 478871: Switch to new_font() and default_substitute() functions from Pango API to fix compile issues with newer pango versions. r=behdad sr=roc
This commit is contained in:
parent
b2fe202312
commit
040ed7df68
@ -1797,23 +1797,17 @@ PrepareSortPattern(FcPattern *aPattern, double aFallbackSize,
|
||||
}
|
||||
|
||||
static void
|
||||
gfx_pango_font_map_context_substitute(PangoFcFontMap *fontmap,
|
||||
PangoContext *context,
|
||||
gfx_pango_font_map_default_substitute(PangoFcFontMap *fontmap,
|
||||
FcPattern *pattern)
|
||||
{
|
||||
// owned by the context
|
||||
PangoFontDescription *desc = pango_context_get_font_description(context);
|
||||
double size = pango_font_description_get_size(desc) / FLOAT_PANGO_SCALE;
|
||||
gfxPangoFontGroup *fontGroup = GetFontGroup(context);
|
||||
PRBool usePrinterFont = fontGroup && fontGroup->GetStyle()->printerFont;
|
||||
PrepareSortPattern(pattern, size, 1.0, usePrinterFont);
|
||||
// The context is not available here but most of our rendering is for the
|
||||
// screen so aIsPrinterFont is set to FALSE.
|
||||
PrepareSortPattern(pattern, 18.0, 1.0, FALSE);
|
||||
}
|
||||
|
||||
static PangoFcFont *
|
||||
gfx_pango_font_map_create_font(PangoFcFontMap *fontmap,
|
||||
PangoContext *context,
|
||||
const PangoFontDescription *desc,
|
||||
FcPattern *pattern)
|
||||
gfx_pango_font_map_new_font(PangoFcFontMap *fontmap,
|
||||
FcPattern *pattern)
|
||||
{
|
||||
return PANGO_FC_FONT(g_object_new(GFX_TYPE_PANGO_FC_FONT,
|
||||
"pattern", pattern, NULL));
|
||||
@ -1836,10 +1830,14 @@ gfx_pango_font_map_class_init(gfxPangoFontMapClass *klass)
|
||||
// context_key_* virtual functions are only necessary if we want to
|
||||
// dynamically respond to changes in the screen cairo_font_options_t.
|
||||
|
||||
// context_substitute and get_font are not likely to be used but
|
||||
// implemented because the class makes them available.
|
||||
fcfontmap_class->context_substitute = gfx_pango_font_map_context_substitute;
|
||||
fcfontmap_class->create_font = gfx_pango_font_map_create_font;
|
||||
// The APIs for context_substitute/fontset_key_substitute and create_font
|
||||
// changed between Pango 1.22 and 1.24 so default_substitute and
|
||||
// new_font are provided instead.
|
||||
// default_substitute and new_font are not likely to be used but
|
||||
// implemented because the class makes them available and an
|
||||
// implementation should provide either create_font or new_font.
|
||||
fcfontmap_class->default_substitute = gfx_pango_font_map_default_substitute;
|
||||
fcfontmap_class->new_font = gfx_pango_font_map_new_font;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user