summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2022-04-13 15:44:57 +0000
committerMatthias Clasen <mclasen@redhat.com>2022-04-13 15:44:57 +0000
commit1f29168ed4441b7e1406ceaa9f417dc50da93105 (patch)
tree1ff1ae9d93b250f5492dff0462ff2177fabbe1e0
parent65b2334a8e2089aa555433cd435f63c83ecb2b51 (diff)
parent9ede41198b85ce6e779a51acc2497f049258af83 (diff)
downloadpango-1f29168ed4441b7e1406ceaa9f417dc50da93105.tar.gz
Merge branch 'survive-without-fonts' into 'main'
layout: Try harder to survive without fonts Closes #680 See merge request GNOME/pango!610
-rw-r--r--pango/pango-layout.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/pango/pango-layout.c b/pango/pango-layout.c
index eb674b50..2b03ee2c 100644
--- a/pango/pango-layout.c
+++ b/pango/pango-layout.c
@@ -6624,7 +6624,7 @@ collect_baseline_shift (ParaBreakState *state,
int subscript_y_offset = 0;
- if (prev)
+ if (prev && prev->analysis.font)
{
hb_font_t *hb_font = pango_font_get_hb_font (prev->analysis.font);
hb_ot_metrics_get_position (hb_font, HB_OT_METRICS_TAG_SUPERSCRIPT_EM_Y_OFFSET, &superscript_y_offset);
@@ -6716,7 +6716,12 @@ apply_baseline_shift (PangoLayoutLine *line,
hb_tag_t lang_tags[HB_OT_MAX_TAGS_PER_LANGUAGE];
unsigned int script_count = HB_OT_MAX_TAGS_PER_SCRIPT;
unsigned int lang_count = HB_OT_MAX_TAGS_PER_LANGUAGE;
+#endif
+
+ if (item->analysis.font == NULL)
+ continue;
+#if HB_VERSION_ATLEAST(4,0,0)
hb_font = pango_font_get_hb_font (item->analysis.font);
script = (hb_script_t) g_unicode_script_to_iso15924 (item->analysis.script);