diff options
author | Owen Taylor <otaylor@redhat.com> | 2000-11-14 16:11:02 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@src.gnome.org> | 2000-11-14 16:11:02 +0000 |
commit | e6e7df5c4d77e8e9802cfe615b9265176be1314c (patch) | |
tree | f14288f107b39a331854aacbb3d415428dfa5631 /pango/pango-layout.c | |
parent | 8c0b3b59674586d069dba895929f23ee6c9ea91b (diff) | |
download | pango-e6e7df5c4d77e8e9802cfe615b9265176be1314c.tar.gz |
Fix low underline code to deal with run_ink == NULL.
Tue Nov 14 11:10:24 2000 Owen Taylor <otaylor@redhat.com>
* pango/pango-layout.c (pango_layout_run_get_extents):
Fix low underline code to deal with run_ink == NULL.
* pango/pango-utils.c (pango_read_line): Return number
of lines read to allow decent parse errors line numbers.
* pango/pangox-fontmap.c (pango_x_font_map_read_alias_file):
Fix line number count.
* examples/pangox.aliases: Include extra international fonts
for all styles, not just roman, reindent so it looks
halfway legible.
Diffstat (limited to 'pango/pango-layout.c')
-rw-r--r-- | pango/pango-layout.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/pango/pango-layout.c b/pango/pango-layout.c index 46ae0231..7f767f83 100644 --- a/pango/pango-layout.c +++ b/pango/pango-layout.c @@ -2868,22 +2868,29 @@ pango_layout_run_get_extents (PangoLayoutRun *run, PangoRectangle shape_ink; PangoRectangle shape_logical; + PangoRectangle tmp_ink; gboolean shape_set; + gboolean need_ink; pango_layout_get_item_properties (run->item, &uline, &shape_ink, &shape_logical, &shape_set); if (shape_setp) *shape_setp = shape_set; + + need_ink = run_ink || uline == PANGO_UNDERLINE_LOW; if (shape_set) imposed_extents (run->item->num_chars, &shape_ink, &shape_logical, - (uline != PANGO_UNDERLINE_NONE) ? run_ink : NULL, run_logical); + need_ink ? &tmp_ink : NULL, run_logical); else pango_glyph_string_extents (run->glyphs, run->item->analysis.font, - (uline != PANGO_UNDERLINE_NONE) ? run_ink : NULL, + need_ink ? &tmp_ink : NULL, run_logical); + if (run_ink) + *run_ink = tmp_ink; + switch (uline) { case PANGO_UNDERLINE_NONE: @@ -2899,12 +2906,12 @@ pango_layout_run_get_extents (PangoLayoutRun *run, run_logical->height = MAX (run_logical->height, 4 * PANGO_SCALE - run_logical->y); break; case PANGO_UNDERLINE_LOW: - if (run_ink) - run_ink->height += 2 * PANGO_SCALE; - /* FIXME: Should this simply be run_logical->height += 2 * PANGO_SCALE instead? */ - run_logical->height = MAX (run_logical->height, run_ink->y + run_ink->height - run_logical->y); + if (run_ink) + run_ink->height += 2 * PANGO_SCALE; + run_logical->height = MAX (run_logical->height, + tmp_ink.y + tmp_ink.height + 2 * PANGO_SCALE - run_logical->y); break; } } |