diff options
author | Owen Taylor <otaylor@redhat.com> | 2005-05-16 18:00:22 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@src.gnome.org> | 2005-05-16 18:00:22 +0000 |
commit | a1d091f8b9fa18792c6d989a5eb7c8bad1c87258 (patch) | |
tree | 07faa7897569c0196b7774af26a5fdfdbdfd92b6 /pango/pangocairo-render.c | |
parent | 774df2fe97bc6180fe55659ccff10c349976a022 (diff) | |
download | pango-a1d091f8b9fa18792c6d989a5eb7c8bad1c87258.tar.gz |
pango/pangocairo-render.c (pango_cairo_renderer_draw_glyphs): Handle glyph
2005-05-16 Owen Taylor <otaylor@redhat.com>
* pango/pangocairo-fcfont.c (pango_cairo_fc_font_get_glyph_extents):
pango/pangocairo-render.c (pango_cairo_renderer_draw_glyphs):
Handle glyph == 0.
* modules/indic/indic-ot.h modules/basic/basic-common.h:
Treat LINE SEPARATOR as a zero-width character.
Diffstat (limited to 'pango/pangocairo-render.c')
-rw-r--r-- | pango/pangocairo-render.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/pango/pangocairo-render.c b/pango/pangocairo-render.c index 9a1048ce..68ae4981 100644 --- a/pango/pangocairo-render.c +++ b/pango/pangocairo-render.c @@ -68,7 +68,7 @@ pango_cairo_renderer_draw_glyphs (PangoRenderer *renderer, /* cairo_glyph_t is 24 bytes */ #define MAX_STACK 40 - int i; + int i, count; int x_position = 0; cairo_glyph_t *cairo_glyphs; cairo_glyph_t stack_glyphs[MAX_STACK]; @@ -85,23 +85,29 @@ pango_cairo_renderer_draw_glyphs (PangoRenderer *renderer, else cairo_glyphs = stack_glyphs; + count = 0; for (i = 0; i < glyphs->num_glyphs; i++) { PangoGlyphInfo *gi = &glyphs->glyphs[i]; - cairo_glyphs[i].index = gi->glyph; - cairo_glyphs[i].x = crenderer->x_offset + (double)(x + x_position + gi->geometry.x_offset) / PANGO_SCALE; - cairo_glyphs[i].y = crenderer->y_offset + (double)(y + gi->geometry.y_offset) / PANGO_SCALE; + 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++; + } + x_position += gi->geometry.width; } _pango_cairo_font_install (PANGO_CAIRO_FONT (font), crenderer->cr); if (crenderer->do_path) - cairo_glyph_path (crenderer->cr, cairo_glyphs, glyphs->num_glyphs); + cairo_glyph_path (crenderer->cr, cairo_glyphs, count); else - cairo_show_glyphs (crenderer->cr, cairo_glyphs, glyphs->num_glyphs); + cairo_show_glyphs (crenderer->cr, cairo_glyphs, count); if (glyphs->num_glyphs > MAX_STACK) g_free (cairo_glyphs); |