]> git.imager.perl.org - imager.git/commitdiff
Fixed empty string handling for tt font driver.
authorArnar Mar Hrafnkelsson <addi@cpan.org>
Thu, 30 May 2002 17:00:45 +0000 (17:00 +0000)
committerArnar Mar Hrafnkelsson <addi@cpan.org>
Thu, 30 May 2002 17:00:45 +0000 (17:00 +0000)
Changes
font.c

diff --git a/Changes b/Changes
index 4ca5bcbfc8b7b7d65df287e28b6c4f5aa998b7f6..2da9fc991127fd74c5449ac8b4497b57f20d7a71 100644 (file)
--- a/Changes
+++ b/Changes
@@ -669,8 +669,9 @@ Revision history for Perl extension Imager.
           low-level output functions
         - OO interfaces to UTF8 and flags, for now leaving the flags as
           specific to Imager::Font::Type1
-       - mc_web_map was storing colors with an alpha of 0
+        - mc_web_map was storing colors with an alpha of 0
         - update the URLs for libpng and zlib
+                               - Fixed empty string handling for tt font driver.
 
 =================================================================
 
diff --git a/font.c b/font.c
index 499079d0eaadfc44cf215e71c7d606054f7acdac..15037ad7363cd55533fe0fe223e4b26db0cfaada 100644 (file)
--- a/font.c
+++ b/font.c
@@ -1387,11 +1387,20 @@ Function to get texts bounding boxes given the instance of the font (internal)
 static
 undef_int
 i_tt_bbox_inst( TT_Fonthandle *handle, int inst ,const char *txt, int len, int cords[6], int utf8 ) {
-  int i, upm, ascent, descent, gascent, gdescent, width, casc, cdesc, first, start;
+  int i, upm, casc, cdesc, first;
+  
+  int start    = 0;
+  int width    = 0;
+  int gdescent = 0;
+  int gascent  = 0;
+  int descent  = 0;
+  int ascent   = 0;
+  
+
   unsigned long j;
   unsigned char *ustr;
   ustr=(unsigned char*)txt;
-  
+
   mm_log((1,"i_tt_box_inst(handle 0x%X,inst %d,txt '%.*s', len %d, utf8 %d)\n",handle,inst,len,txt,len, utf8));
 
   upm     = handle->properties.header->Units_Per_EM;