diff options
author | Owen Taylor <otaylor@redhat.com> | 2004-06-21 15:32:22 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@src.gnome.org> | 2004-06-21 15:32:22 +0000 |
commit | ffc0b21393fcfb8be247afe7ad32291ab4431d4a (patch) | |
tree | 8dc2ad7b0798249688419efec01dfbe8c21d99d9 /pango/pangoft2.c | |
parent | 329566a3e3af0cfebdb561978e6622ebe8208108 (diff) | |
download | pango-ffc0b21393fcfb8be247afe7ad32291ab4431d4a.tar.gz |
For cleanliness, unref the fontmap if we get an error from FreeType.
Mon Jun 21 11:29:39 2004 Owen Taylor <otaylor@redhat.com>
* pango/pangoft2-fontmap.c (pango_ft2_font_map_new):
For cleanliness, unref the fontmap if we get an error
from FreeType. (#143524, Morten Welinder)
* pango/pangoft2-fontmap.c (pango_ft2_font_map_finalize):
Deal with NULL ft2fontmap->library.
Diffstat (limited to 'pango/pangoft2.c')
-rw-r--r-- | pango/pangoft2.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/pango/pangoft2.c b/pango/pangoft2.c index 5de9ca7e..53601cac 100644 --- a/pango/pangoft2.c +++ b/pango/pangoft2.c @@ -594,9 +594,21 @@ pango_ft2_font_get_glyph_info (PangoFont *font, info->logical_rect.x = 0; info->logical_rect.width = PANGO_UNITS_26_6 (gm->horiAdvance); - info->logical_rect.y = -PANGO_UNITS_26_6 (face->size->metrics.ascender + 64); - /* Some fonts report negative descender, some positive ! (?) */ - info->logical_rect.height = PANGO_UNITS_26_6 (face->size->metrics.ascender + ABS (face->size->metrics.descender) + 128); + if (ft2font->load_flags & FT_LOAD_NO_HINTING) + { + FT_Fixed ascender, descender; + + ascender = FT_MulFix (face->ascender, face->size->metrics.y_scale); + descender = FT_MulFix (face->descender, face->size->metrics.y_scale); + + info->logical_rect.y = - PANGO_UNITS_26_6 (ascender); + info->logical_rect.height = PANGO_UNITS_26_6 (ascender - descender); + } + else + { + info->logical_rect.y = - PANGO_UNITS_26_6 (face->size->metrics.ascender); + info->logical_rect.height = PANGO_UNITS_26_6 (face->size->metrics.ascender - face->size->metrics.descender); + } } else { |