diff options
Diffstat (limited to 'pango/pango-layout.c')
-rw-r--r-- | pango/pango-layout.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/pango/pango-layout.c b/pango/pango-layout.c index b07c8487..68ffd190 100644 --- a/pango/pango-layout.c +++ b/pango/pango-layout.c @@ -1173,6 +1173,7 @@ pango_layout_set_text (PangoLayout *layout, g_warning ("Invalid UTF-8 string passed to pango_layout_set_text()"); layout->n_chars = pango_utf8_strlen (layout->text, -1); + layout->length = strlen (layout->text); layout_changed (layout); @@ -3608,6 +3609,9 @@ find_hyphen_width (PangoItem *item) hb_font_t *hb_font; hb_codepoint_t glyph; + if (!item->analysis.font) + return 0; + /* This is not technically correct, since * a) we may end up inserting a different hyphen * b) we should reshape the entire run @@ -4084,6 +4088,7 @@ process_line (PangoLayout *layout, static void get_items_log_attrs (const char *text, + int start, int length, GList *items, PangoLogAttr *log_attrs, @@ -4092,11 +4097,13 @@ get_items_log_attrs (const char *text, int offset = 0; GList *l; - pango_default_break (text, length, NULL, log_attrs, log_attrs_len); + pango_default_break (text + start, length, NULL, log_attrs, log_attrs_len); for (l = items; l; l = l->next) { PangoItem *item = l->data; + g_assert (item->offset <= start + length); + g_assert (item->length <= (start + length) - item->offset); pango_tailor_break (text + item->offset, item->length, @@ -4367,7 +4374,8 @@ pango_layout_check_lines (PangoLayout *layout) apply_attributes_to_items (state.items, shape_attrs); - get_items_log_attrs (start, + get_items_log_attrs (layout->text, + start - layout->text, delimiter_index + delim_len, state.items, layout->log_attrs + start_offset, |