text: Don't produce fontless text nodes

Pango items can in fact come out of itemization without a font,
and pango limps along, trying to render hexboxes in this case.
For gsk, it seems much easier to just not generate anything in
this corner case, rather than trying to make everything we do
with the font NULL-safe.
This commit is contained in:
Matthias Clasen 2024-12-28 07:54:57 -05:00
parent b43876dd26
commit 6663ad53a0

View File

@ -112,12 +112,13 @@ gsk_pango_renderer_draw_glyph_item (PangoRenderer *renderer,
get_color (crenderer, PANGO_RENDER_PART_FOREGROUND, &color);
gtk_snapshot_append_text2 (crenderer->snapshot,
glyph_item->item->analysis.font,
glyph_item->glyphs,
&color,
(float) x / PANGO_SCALE,
(float) y / PANGO_SCALE);
if (glyph_item->item->analysis.font)
gtk_snapshot_append_text2 (crenderer->snapshot,
glyph_item->item->analysis.font,
glyph_item->glyphs,
&color,
(float) x / PANGO_SCALE,
(float) y / PANGO_SCALE);
gdk_color_finish (&color);