_cairo_scaled_font_keys_equal: Also check implementation font-face

"Placeholder" scaled fonts created temporarily by cairo-user-font.c never
get to have an original_font_face (that is, it's always NULL). This breaks
the font-map mapping. Also check the implementation font-face.

Fixes #876
This commit is contained in:
Luca Bacci 2026-04-17 11:34:36 +02:00
parent 1adaf1e7c5
commit 46d1e26cdb
2 changed files with 2 additions and 2 deletions

View file

@ -87,9 +87,8 @@ struct _cairo_scaled_font {
cairo_reference_count_t ref_count;
cairo_user_data_array_t user_data;
cairo_font_face_t *original_font_face; /* may be NULL */
/* hash key members */
cairo_font_face_t *original_font_face; /* may be NULL */
cairo_font_face_t *font_face; /* may be NULL */
cairo_matrix_t font_matrix; /* font space => user space */
cairo_matrix_t ctm; /* user space => device space */

View file

@ -692,6 +692,7 @@ _cairo_scaled_font_keys_equal (const void *abstract_key_a,
const cairo_scaled_font_t *key_b = abstract_key_b;
return key_a->original_font_face == key_b->original_font_face &&
key_a->font_face == key_b->font_face &&
memcmp ((unsigned char *)(&key_a->font_matrix.xx),
(unsigned char *)(&key_b->font_matrix.xx),
sizeof(cairo_matrix_t)) == 0 &&