summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pango/pango-layout.c26
1 files changed, 1 insertions, 25 deletions
diff --git a/pango/pango-layout.c b/pango/pango-layout.c
index bf7c5fc5..ebc9ce67 100644
--- a/pango/pango-layout.c
+++ b/pango/pango-layout.c
@@ -3737,23 +3737,6 @@ find_hyphen_width (PangoItem *item)
return 0;
}
-static int
-find_char_width (PangoItem *item,
- gunichar wc)
-{
- hb_font_t *hb_font;
- hb_codepoint_t glyph;
-
- if (!item->analysis.font)
- return 0;
-
- hb_font = pango_font_get_hb_font (item->analysis.font);
- if (hb_font_get_nominal_glyph (hb_font, wc, &glyph))
- return hb_font_get_glyph_h_advance (hb_font, glyph);
-
- return 0;
-}
-
static inline void
ensure_hyphen_width (ParaBreakState *state)
{
@@ -3775,14 +3758,7 @@ find_break_extra_width (PangoLayout *layout,
ensure_hyphen_width (state);
if (layout->log_attrs[state->start_offset + pos].break_removes_preceding)
- {
- PangoItem *item = state->items->data;
- gunichar wc;
-
- wc = g_utf8_get_char (g_utf8_offset_to_pointer (layout->text, state->start_offset + pos - 1));
-
- return state->hyphen_width - find_char_width (item, wc);
- }
+ return state->hyphen_width - state->log_widths[state->log_widths_offset + pos - 1];
else
return state->hyphen_width;
}