[cairo] Version-check the variations code

This commit is contained in:
Behdad Esfahbod 2023-01-16 13:14:58 -07:00
parent a180ae43ce
commit f11271cc03
1 changed files with 2 additions and 0 deletions

View File

@ -379,6 +379,7 @@ hb_cairo_init_scaled_font (cairo_scaled_font_t *scaled_font,
&hb_cairo_face_user_data_key); &hb_cairo_face_user_data_key);
font = hb_font_create (face); font = hb_font_create (face);
#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1,16,0)
cairo_font_options_t *font_options = cairo_font_options_create (); cairo_font_options_t *font_options = cairo_font_options_create ();
// Set variations // Set variations
@ -397,6 +398,7 @@ hb_cairo_init_scaled_font (cairo_scaled_font_t *scaled_font,
hb_font_set_variations (font, &vars[0], vars.length); hb_font_set_variations (font, &vars[0], vars.length);
cairo_font_options_destroy (font_options); cairo_font_options_destroy (font_options);
#endif
// Set scale; Note: should NOT set slant, or we'll double-slant. // Set scale; Note: should NOT set slant, or we'll double-slant.
unsigned scale_factor = hb_cairo_font_face_get_scale_factor (font_face); unsigned scale_factor = hb_cairo_font_face_get_scale_factor (font_face);