mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-12 21:40:19 +00:00
gsk: Add a private helper
Add a function to get the hint style of a font.
This commit is contained in:
parent
d1b52cc292
commit
81c97f0910
@ -158,3 +158,27 @@ gsk_get_hinted_font (PangoFont *font,
|
||||
return font;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*< private >
|
||||
* gsk_font_get_hint_style:
|
||||
* @font: a `PangoFont`
|
||||
*
|
||||
* Get the hint style from the cairo font options.
|
||||
*
|
||||
* Returns: the hint style
|
||||
*/
|
||||
cairo_hint_style_t
|
||||
gsk_font_get_hint_style (PangoFont *font)
|
||||
{
|
||||
cairo_scaled_font_t *sf;
|
||||
cairo_font_options_t *options;
|
||||
cairo_hint_style_t style;
|
||||
|
||||
sf = pango_cairo_font_get_scaled_font (PANGO_CAIRO_FONT (font));
|
||||
options = cairo_font_options_create ();
|
||||
cairo_scaled_font_get_font_options (sf, options);
|
||||
style = cairo_font_options_get_hint_style (options);
|
||||
cairo_font_options_destroy (options);
|
||||
|
||||
return style;
|
||||
}
|
||||
|
@ -15,5 +15,7 @@ PangoFont *gsk_get_hinted_font (PangoFont *font,
|
||||
cairo_hint_style_t hint_style,
|
||||
cairo_antialias_t antialias);
|
||||
|
||||
cairo_hint_style_t gsk_font_get_hint_style (PangoFont *font);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user