Commit c38ddff8ac29a51470f05503f438038bba62bdd4

David Turner 2000-08-21T04:43:01

fixed a _serious_ bug in FT_Glyph_Get_CBox

diff --git a/src/base/ftglyph.c b/src/base/ftglyph.c
index 4052e6e..99cd7b8 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;
   }