diff options
author | Behdad Esfahbod <behdad@behdad.org> | 2009-04-06 19:43:17 -0400 |
---|---|---|
committer | Behdad Esfahbod <behdad@behdad.org> | 2009-04-06 19:43:43 -0400 |
commit | 1e990af007255d1137ec76bd86658198d73994c6 (patch) | |
tree | f8b624f16cbf7817d4e9383a263ea80b31cbf931 /pango/pangoft2.c | |
parent | e61e53f197bf238269a9db736901e64fd999190a (diff) | |
download | pango-1e990af007255d1137ec76bd86658198d73994c6.tar.gz |
[xft,ft2] Fix empty-glyph logical extents
Previously we were returning zero. We now return the height of the
glyph for space.
Diffstat (limited to 'pango/pangoft2.c')
-rw-r--r-- | pango/pangoft2.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/pango/pangoft2.c b/pango/pangoft2.c index 224f6a0c..dd268b96 100644 --- a/pango/pangoft2.c +++ b/pango/pangoft2.c @@ -318,14 +318,12 @@ pango_ft2_font_get_glyph_extents (PangoFont *font, PangoRectangle *logical_rect) { PangoFT2GlyphInfo *info; + gboolean empty = FALSE; if (glyph == PANGO_GLYPH_EMPTY) { - if (ink_rect) - ink_rect->x = ink_rect->y = ink_rect->height = ink_rect->width = 0; - if (logical_rect) - logical_rect->x = logical_rect->y = logical_rect->height = logical_rect->width = 0; - return; + glyph = pango_fc_font_get_glyph (font, ' '); + empty = TRUE; } if (glyph & PANGO_GLYPH_UNKNOWN_FLAG) @@ -367,6 +365,15 @@ pango_ft2_font_get_glyph_extents (PangoFont *font, *ink_rect = info->ink_rect; if (logical_rect) *logical_rect = info->logical_rect; + + if (empty) + { + if (ink_rect) + ink_rect->x = ink_rect->y = ink_rect->height = ink_rect->width = 0; + if (logical_rect) + logical_rect->x = logical_rect->width = 0; + return; + } } /** |