From 834a0b94d90aced253960a85c85a9a2beeabfda7 Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Wed, 15 Nov 2000 00:15:28 +0000 Subject: get the value of any rise attribute (pango_layout_run_get_extents): take 2000-11-14 Havoc Pennington * pango/pango-layout.c (pango_layout_get_item_properties): get the value of any rise attribute (pango_layout_run_get_extents): take rise into account --- ChangeLog | 6 ++++++ ChangeLog.pre-1-0 | 6 ++++++ ChangeLog.pre-1-10 | 6 ++++++ ChangeLog.pre-1-2 | 6 ++++++ ChangeLog.pre-1-4 | 6 ++++++ ChangeLog.pre-1-6 | 6 ++++++ ChangeLog.pre-1-8 | 6 ++++++ pango/pango-layout.c | 38 +++++++++++++++++++++++++++++++------- 8 files changed, 73 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 424f4819..bbfbde71 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2000-11-14 Havoc Pennington + + * pango/pango-layout.c (pango_layout_get_item_properties): get the + value of any rise attribute + (pango_layout_run_get_extents): take rise into account + 2000-11-15 Tor Lillqvist * config.h.win32: Define HAVE_FRIBIDI. diff --git a/ChangeLog.pre-1-0 b/ChangeLog.pre-1-0 index 424f4819..bbfbde71 100644 --- a/ChangeLog.pre-1-0 +++ b/ChangeLog.pre-1-0 @@ -1,3 +1,9 @@ +2000-11-14 Havoc Pennington + + * pango/pango-layout.c (pango_layout_get_item_properties): get the + value of any rise attribute + (pango_layout_run_get_extents): take rise into account + 2000-11-15 Tor Lillqvist * config.h.win32: Define HAVE_FRIBIDI. diff --git a/ChangeLog.pre-1-10 b/ChangeLog.pre-1-10 index 424f4819..bbfbde71 100644 --- a/ChangeLog.pre-1-10 +++ b/ChangeLog.pre-1-10 @@ -1,3 +1,9 @@ +2000-11-14 Havoc Pennington + + * pango/pango-layout.c (pango_layout_get_item_properties): get the + value of any rise attribute + (pango_layout_run_get_extents): take rise into account + 2000-11-15 Tor Lillqvist * config.h.win32: Define HAVE_FRIBIDI. diff --git a/ChangeLog.pre-1-2 b/ChangeLog.pre-1-2 index 424f4819..bbfbde71 100644 --- a/ChangeLog.pre-1-2 +++ b/ChangeLog.pre-1-2 @@ -1,3 +1,9 @@ +2000-11-14 Havoc Pennington + + * pango/pango-layout.c (pango_layout_get_item_properties): get the + value of any rise attribute + (pango_layout_run_get_extents): take rise into account + 2000-11-15 Tor Lillqvist * config.h.win32: Define HAVE_FRIBIDI. diff --git a/ChangeLog.pre-1-4 b/ChangeLog.pre-1-4 index 424f4819..bbfbde71 100644 --- a/ChangeLog.pre-1-4 +++ b/ChangeLog.pre-1-4 @@ -1,3 +1,9 @@ +2000-11-14 Havoc Pennington + + * pango/pango-layout.c (pango_layout_get_item_properties): get the + value of any rise attribute + (pango_layout_run_get_extents): take rise into account + 2000-11-15 Tor Lillqvist * config.h.win32: Define HAVE_FRIBIDI. diff --git a/ChangeLog.pre-1-6 b/ChangeLog.pre-1-6 index 424f4819..bbfbde71 100644 --- a/ChangeLog.pre-1-6 +++ b/ChangeLog.pre-1-6 @@ -1,3 +1,9 @@ +2000-11-14 Havoc Pennington + + * pango/pango-layout.c (pango_layout_get_item_properties): get the + value of any rise attribute + (pango_layout_run_get_extents): take rise into account + 2000-11-15 Tor Lillqvist * config.h.win32: Define HAVE_FRIBIDI. diff --git a/ChangeLog.pre-1-8 b/ChangeLog.pre-1-8 index 424f4819..bbfbde71 100644 --- a/ChangeLog.pre-1-8 +++ b/ChangeLog.pre-1-8 @@ -1,3 +1,9 @@ +2000-11-14 Havoc Pennington + + * pango/pango-layout.c (pango_layout_get_item_properties): get the + value of any rise attribute + (pango_layout_run_get_extents): take rise into account + 2000-11-15 Tor Lillqvist * config.h.win32: Define HAVE_FRIBIDI. diff --git a/pango/pango-layout.c b/pango/pango-layout.c index 7f767f83..853ebf8c 100644 --- a/pango/pango-layout.c +++ b/pango/pango-layout.c @@ -139,6 +139,7 @@ static int *pango_layout_line_get_vis2log_map (PangoLayoutLine *line, static void pango_layout_get_item_properties (PangoItem *item, PangoUnderline *uline, + gint *rise, PangoRectangle *ink_rect, PangoRectangle *logical_rect, gboolean *shape_set); @@ -852,7 +853,8 @@ pango_layout_line_index_to_x (PangoLayoutLine *line, PangoLayoutRun *run = run_list->data; gboolean shape_set; - pango_layout_get_item_properties (run->item, NULL, NULL, &logical_rect, &shape_set); + pango_layout_get_item_properties (run->item, NULL, NULL, NULL, + &logical_rect, &shape_set); if (run->item->offset <= index && run->item->offset + run->item->length > index) { @@ -2112,7 +2114,8 @@ process_item (PangoLayoutLine *line, int length; int i; - pango_layout_get_item_properties (item, NULL, &shape_ink, &shape_logical, &shape_set); + pango_layout_get_item_properties (item, NULL, NULL, + &shape_ink, &shape_logical, &shape_set); if (shape_set) imposed_shape (item->num_chars, &shape_ink, &shape_logical, glyphs); @@ -2573,7 +2576,8 @@ pango_layout_line_x_to_index (PangoLayoutLine *line, PangoLayoutRun *run = tmp_list->data; gboolean shape_set; - pango_layout_get_item_properties (run->item, NULL, NULL, &logical_rect, &shape_set); + pango_layout_get_item_properties (run->item, NULL, NULL, + NULL, &logical_rect, &shape_set); if (!shape_set) pango_glyph_string_extents (run->glyphs, run->item->analysis.font, NULL, &logical_rect); @@ -2865,14 +2869,14 @@ pango_layout_run_get_extents (PangoLayoutRun *run, PangoRectangle *run_logical) { PangoUnderline uline = PANGO_UNDERLINE_NONE; - + int rise = 0; PangoRectangle shape_ink; PangoRectangle shape_logical; PangoRectangle tmp_ink; gboolean shape_set; gboolean need_ink; - pango_layout_get_item_properties (run->item, &uline, + pango_layout_get_item_properties (run->item, &uline, &rise, &shape_ink, &shape_logical, &shape_set); if (shape_setp) @@ -2914,6 +2918,14 @@ pango_layout_run_get_extents (PangoLayoutRun *run, tmp_ink.y + tmp_ink.height + 2 * PANGO_SCALE - run_logical->y); break; } + + if (rise != 0) + { + if (run_ink) + run_ink->y -= rise; + + run_logical->y -= rise; + } } /** @@ -3159,6 +3171,7 @@ pango_layout_line_postprocess (PangoLayoutLine *line) static void pango_layout_get_item_properties (PangoItem *item, PangoUnderline *uline, + gint *rise, PangoRectangle *ink_rect, PangoRectangle *logical_rect, gboolean *shape_set) @@ -3167,7 +3180,13 @@ pango_layout_get_item_properties (PangoItem *item, if (shape_set) *shape_set = FALSE; - + + if (rise) + *rise = 0; + + if (uline) + *uline = PANGO_UNDERLINE_NONE; + while (tmp_list) { PangoAttribute *attr = tmp_list->data; @@ -3178,7 +3197,12 @@ pango_layout_get_item_properties (PangoItem *item, if (uline) *uline = ((PangoAttrInt *)attr)->value; break; - + + case PANGO_ATTR_RISE: + if (rise) + *rise = ((PangoAttrInt *)attr)->value; + break; + case PANGO_ATTR_SHAPE: if (shape_set) *shape_set = TRUE; -- cgit v1.2.1