summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@gnome.org>2006-06-07 06:07:59 +0000
committerBehdad Esfahbod <behdad@src.gnome.org>2006-06-07 06:07:59 +0000
commit6fb881a2d90dfd1254745f2ac8d43bd36b1720d1 (patch)
treedff4d575f7e086b8611740957eb0874fb39eef1b
parenta70d83cd50324c02be5cb1293ba5d740634470ee (diff)
downloadpango-6fb881a2d90dfd1254745f2ac8d43bd36b1720d1.tar.gz
Bug 326960 – hex box drawing for win32 and atsui backends of cairo
2006-06-07 Behdad Esfahbod <behdad@gnome.org> 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.
-rw-r--r--ChangeLog9
-rw-r--r--pango/pangocairo-atsuifont.c34
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 <behdad@gnome.org>
+
+ 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 <behdad@gnome.org>
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;
}
}