diff options
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | ChangeLog.pre-1-10 | 9 | ||||
-rw-r--r-- | ChangeLog.pre-1-6 | 9 | ||||
-rw-r--r-- | ChangeLog.pre-1-8 | 9 | ||||
-rw-r--r-- | pango/pangofc-font.c | 12 | ||||
-rw-r--r-- | pango/pangoft2-fontmap.c | 4 | ||||
-rw-r--r-- | pango/pangoft2.c | 18 |
7 files changed, 65 insertions, 5 deletions
@@ -1,3 +1,12 @@ +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. + 2004-06-17 Christopher Blizzard <blizzard@redhat.com> * pango/pangofc-decoder.c (pango_fc_decoder_get_glyph, diff --git a/ChangeLog.pre-1-10 b/ChangeLog.pre-1-10 index c2c3b919..f222b904 100644 --- a/ChangeLog.pre-1-10 +++ b/ChangeLog.pre-1-10 @@ -1,3 +1,12 @@ +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. + 2004-06-17 Christopher Blizzard <blizzard@redhat.com> * pango/pangofc-decoder.c (pango_fc_decoder_get_glyph, diff --git a/ChangeLog.pre-1-6 b/ChangeLog.pre-1-6 index c2c3b919..f222b904 100644 --- a/ChangeLog.pre-1-6 +++ b/ChangeLog.pre-1-6 @@ -1,3 +1,12 @@ +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. + 2004-06-17 Christopher Blizzard <blizzard@redhat.com> * pango/pangofc-decoder.c (pango_fc_decoder_get_glyph, diff --git a/ChangeLog.pre-1-8 b/ChangeLog.pre-1-8 index c2c3b919..f222b904 100644 --- a/ChangeLog.pre-1-8 +++ b/ChangeLog.pre-1-8 @@ -1,3 +1,12 @@ +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. + 2004-06-17 Christopher Blizzard <blizzard@redhat.com> * pango/pangofc-decoder.c (pango_fc_decoder_get_glyph, diff --git a/pango/pangofc-font.c b/pango/pangofc-font.c index a7e35ebf..0f9cdbc6 100644 --- a/pango/pangofc-font.c +++ b/pango/pangofc-font.c @@ -304,11 +304,21 @@ get_face_metrics (PangoFcFont *fcfont, FT_Vector_Transform (&vector, &ft_matrix); metrics->ascent = PANGO_UNITS_26_6 (vector.y); } - else + else if (hinting) { metrics->descent = - PANGO_UNITS_26_6 (face->size->metrics.descender); metrics->ascent = PANGO_UNITS_26_6 (face->size->metrics.ascender); } + else + { + FT_Fixed ascender, descender; + + descender = FT_MulFix (face->descender, face->size->metrics.y_scale); + metrics->descent = - PANGO_UNITS_26_6 (descender); + + ascender = FT_MulFix (face->ascender, face->size->metrics.y_scale); + metrics->ascent = PANGO_UNITS_26_6 (ascender); + } /* Versions of FreeType < 2.1.8 get underline thickness wrong * for Postscript fonts (always zero), so we need a fallback diff --git a/pango/pangoft2-fontmap.c b/pango/pangoft2-fontmap.c index 3460eee8..6bc1936c 100644 --- a/pango/pangoft2-fontmap.c +++ b/pango/pangoft2-fontmap.c @@ -136,7 +136,8 @@ pango_ft2_font_map_finalize (GObject *object) if (ft2fontmap->substitute_destroy) ft2fontmap->substitute_destroy (ft2fontmap->substitute_data); - FT_Done_FreeType (ft2fontmap->library); + if (ft2fontmap->library) + FT_Done_FreeType (ft2fontmap->library); parent_class->finalize (object); } @@ -171,6 +172,7 @@ pango_ft2_font_map_new (void) { g_warning ("Error from FT_Init_FreeType: %s", _pango_ft2_ft_strerror (error)); + g_object_unref (ft2fontmap); return NULL; } 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 { |