mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-01-09 07:40:43 +01:00
Load font variations from fontconfig too
When extracting font options from a fontconfig pattern, also extract font variation information if present.
This commit is contained in:
parent
edf9497c3a
commit
ac5acc4538
1 changed files with 8 additions and 0 deletions
|
|
@ -1714,6 +1714,7 @@ _get_pattern_ft_options (FcPattern *pattern, cairo_ft_options_t *ret)
|
|||
#ifdef FC_HINT_STYLE
|
||||
int hintstyle;
|
||||
#endif
|
||||
char *variations;
|
||||
|
||||
_cairo_font_options_init_default (&ft_options.base);
|
||||
ft_options.load_flags = FT_LOAD_DEFAULT;
|
||||
|
|
@ -1855,6 +1856,13 @@ _get_pattern_ft_options (FcPattern *pattern, cairo_ft_options_t *ret)
|
|||
if (embolden)
|
||||
ft_options.synth_flags |= CAIRO_FT_SYNTHESIZE_BOLD;
|
||||
|
||||
#ifndef FC_FONT_VARIATIONS
|
||||
#define FC_FONT_VARIATIONS "fontvariations"
|
||||
#endif
|
||||
if (FcPatternGetString (pattern, FC_FONT_VARIATIONS, 0, (FcChar8 **) &variations) == FcResultMatch) {
|
||||
ft_options.base.variations = strdup (variations);
|
||||
}
|
||||
|
||||
*ret = ft_options;
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue