From 4d9c9578e748e90cdbfd683b79d89019d84cbec9 Mon Sep 17 00:00:00 2001 From: David Turner Date: Mon, 21 Aug 2000 04:43:01 +0000 Subject: [PATCH] fixed a _serious_ bug in FT_Glyph_Get_CBox --- src/base/ftglyph.c | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/src/base/ftglyph.c b/src/base/ftglyph.c index 4052e6e4f..99cd7b83f 100644 --- a/src/base/ftglyph.c +++ b/src/base/ftglyph.c @@ -665,7 +665,7 @@ } /* convert to integer pixels if needed */ - if ( !( bbox_mode & ft_glyph_bbox_subpixels ) ) + if ( bbox_mode & ft_glyph_bbox_truncate ) { cbox->xMin >>= 6; cbox->yMin >>= 6; @@ -792,8 +792,9 @@ goto Exit; /* prepare dummy slot for rendering */ - error = clazz->glyph_prepare( glyph, &dummy ) || - FT_Render_Glyph_Internal( glyph->library, &dummy, render_mode ); + error = clazz->glyph_prepare( glyph, &dummy ); + if (!error) + error = FT_Render_Glyph_Internal( glyph->library, &dummy, render_mode ); if ( !destroy && origin ) { @@ -1067,11 +1068,21 @@ } /* test orientation of the xmin */ - return ft_test_extrema( outline, indices.xMin ) || - ft_test_extrema( outline, indices.yMin ) || - ft_test_extrema( outline, indices.xMax ) || - ft_test_extrema( outline, indices.yMax ) || - 1; /* this is an empty glyph? */ + n = ft_test_extrema( outline, indices.xMin ); + if (n) goto Exit; + + n = ft_test_extrema( outline, indices.yMin ); + if (n) goto Exit; + + n = ft_test_extrema( outline, indices.xMax ); + if (n) goto Exit; + + n = ft_test_extrema( outline, indices.yMax ); + if (!n) + n = 1; + + Exit: + return n; }