summaryrefslogtreecommitdiff
path: root/pango/pangocairo-render.c
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@gnome.org>2005-12-06 01:20:46 +0000
committerBehdad Esfahbod <behdad@src.gnome.org>2005-12-06 01:20:46 +0000
commit465510ac8ea358512ee361440a9987d10b3d4cf6 (patch)
tree7d46c34ed474e8185b7cc3c92bed052dd7e686c7 /pango/pangocairo-render.c
parentc574499f78c820c3057e017754ae38da2bcf4299 (diff)
downloadpango-465510ac8ea358512ee361440a9987d10b3d4cf6.tar.gz
Draw an empty dashed box on missing glyphs for cairo-fc backend.
2005-12-05 Behdad Esfahbod <behdad@gnome.org> * pango/pangocairo-fcfont.c, pango/pangocairo-private.h, pango/pangocairo-render.c: Draw an empty dashed box on missing glyphs for cairo-fc backend.
Diffstat (limited to 'pango/pangocairo-render.c')
-rw-r--r--pango/pangocairo-render.c32
1 files changed, 27 insertions, 5 deletions
diff --git a/pango/pangocairo-render.c b/pango/pangocairo-render.c
index ea0a800e..16c8054c 100644
--- a/pango/pangocairo-render.c
+++ b/pango/pangocairo-render.c
@@ -92,11 +92,33 @@ pango_cairo_renderer_draw_glyphs (PangoRenderer *renderer,
if (gi->glyph)
{
- cairo_glyphs[count].index = gi->glyph;
- cairo_glyphs[count].x = crenderer->x_offset + (double)(x + x_position + gi->geometry.x_offset) / PANGO_SCALE;
- cairo_glyphs[count].y = crenderer->y_offset + (double)(y + gi->geometry.y_offset) / PANGO_SCALE;
-
- count++;
+ if (gi->glyph & PANGO_CAIRO_UNKNOWN_FLAG)
+ {
+ int mini_pad = gi->geometry.width / 10;
+ /* draw an empty dashed box, no hexbox for now */
+ cairo_rectangle (crenderer->cr,
+ crenderer->x_offset + (double)(x + x_position + mini_pad) / PANGO_SCALE,
+ crenderer->y_offset + (double)(y - mini_pad) / PANGO_SCALE,
+ (double)(gi->geometry.width - 2 * mini_pad) / PANGO_SCALE,
+ -(double)(gi->geometry.width - 2 * mini_pad) / PANGO_SCALE);
+ if (!crenderer->do_path)
+ {
+ double dash = (double)mini_pad * 2 / PANGO_SCALE;
+ cairo_save (crenderer->cr);
+ cairo_set_line_width (crenderer->cr, (double)mini_pad / PANGO_SCALE);
+ cairo_set_dash (crenderer->cr, &dash, 1, 0);
+ cairo_stroke (crenderer->cr);
+ cairo_restore (crenderer->cr);
+ }
+ }
+ else
+ {
+ cairo_glyphs[count].index = gi->glyph;
+ cairo_glyphs[count].x = crenderer->x_offset + (double)(x + x_position + gi->geometry.x_offset) / PANGO_SCALE;
+ cairo_glyphs[count].y = crenderer->y_offset + (double)(y + gi->geometry.y_offset) / PANGO_SCALE;
+
+ count++;
+ }
}
x_position += gi->geometry.width;