From 6fb881a2d90dfd1254745f2ac8d43bd36b1720d1 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 7 Jun 2006 06:07:59 +0000 Subject: =?UTF-8?q?Bug=20326960=20=E2=80=93=20hex=20box=20drawing=20for=20?= =?UTF-8?q?win32=20and=20atsui=20backends=20of=20cairo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2006-06-07 Behdad Esfahbod Bug 326960 – hex box drawing for win32 and atsui backends of cairo Hans already fixed win32. * pango/pangocairo-atsuifont.c (compute_glyph_extents): Handle PANGO_GLYPH_UNKNOWN_FLAG. --- ChangeLog | 9 +++++++++ pango/pangocairo-atsuifont.c | 34 ++++++++++++++++++++-------------- 2 files changed, 29 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3ecf114e..d3b4e781 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2006-06-07 Behdad Esfahbod + + Bug 326960 – hex box drawing for win32 and atsui backends of cairo + + Hans already fixed win32. + + * pango/pangocairo-atsuifont.c (compute_glyph_extents): Handle + PANGO_GLYPH_UNKNOWN_FLAG. + 2006-06-06 Behdad Esfahbod Bug 343717 – License information in unclear. diff --git a/pango/pangocairo-atsuifont.c b/pango/pangocairo-atsuifont.c index fbb74683..7a4379ae 100644 --- a/pango/pangocairo-atsuifont.c +++ b/pango/pangocairo-atsuifont.c @@ -143,6 +143,7 @@ pango_cairo_atsui_font_get_glyph_extents (PangoFont *font, PangoRectangle *ink_rect, PangoRectangle *logical_rect) { + PangoCairoFont *cfont = (PangoCairoFont *)font; cairo_scaled_font_t *scaled_font; cairo_font_extents_t font_extents; cairo_text_extents_t extents; @@ -157,38 +158,43 @@ pango_cairo_atsui_font_get_glyph_extents (PangoFont *font, cairo_glyph.x = 0; cairo_glyph.y = 0; - if (glyph != PANGO_GLYPH_EMPTY) + if (glyph == PANGO_GLYPH_EMPTY) { - cairo_scaled_font_glyph_extents (scaled_font, - &cairo_glyph, 1, &extents); - if (ink_rect) { - ink_rect->x = extents.x_bearing * PANGO_SCALE; - ink_rect->y = extents.y_bearing * PANGO_SCALE; - ink_rect->width = extents.width * PANGO_SCALE; - ink_rect->height = extents.height * PANGO_SCALE; + ink_rect->x = ink_rect->y = ink_rect->width = ink_rect->height = 0; } - if (logical_rect) - { + { logical_rect->x = 0; logical_rect->y = - font_extents.ascent * PANGO_SCALE; - logical_rect->width = extents.x_advance * PANGO_SCALE; + logical_rect->width = 0; logical_rect->height = (font_extents.ascent + font_extents.descent) * PANGO_SCALE; } } + else if (glyph & PANGO_GLYPH_UNKNOWN_FLAG) + { + /* space for the hex box */ + _pango_cairo_get_glyph_extents_missing(cfont, glyph, ink_rect, logical_rect); + } else { + cairo_scaled_font_glyph_extents (scaled_font, + &cairo_glyph, 1, &extents); + if (ink_rect) { - ink_rect->x = ink_rect->y = ink_rect->width = ink_rect->height = 0; + ink_rect->x = extents.x_bearing * PANGO_SCALE; + ink_rect->y = extents.y_bearing * PANGO_SCALE; + ink_rect->width = extents.width * PANGO_SCALE; + ink_rect->height = extents.height * PANGO_SCALE; } + if (logical_rect) - { + { logical_rect->x = 0; logical_rect->y = - font_extents.ascent * PANGO_SCALE; - logical_rect->width = 0; + logical_rect->width = extents.x_advance * PANGO_SCALE; logical_rect->height = (font_extents.ascent + font_extents.descent) * PANGO_SCALE; } } -- cgit v1.2.1