From: kramm <kramm>
Date: Fri, 28 May 2004 08:49:37 +0000 (+0000)
Subject: advance is now in twips, not in pixels.
X-Git-Tag: release-0-6-0~179
X-Git-Url: http://git.asbjorn.it/?a=commitdiff_plain;h=19692420849850353a7caf75201f8044359e7627;p=swftools.git

advance is now in twips, not in pixels.
---

diff --git a/lib/modules/swffont.c b/lib/modules/swffont.c
index 9a572e1..bbc78d9 100644
--- a/lib/modules/swffont.c
+++ b/lib/modules/swffont.c
@@ -131,7 +131,7 @@ SWFFONT* swf_LoadTrueTypeFont(char*filename)
     }
 
     font->layout->ascent = face->ascender; //face->bbox.xMin;
-    font->layout->descent = face->descender; //face->bbox.xMax;
+    font->layout->descent = abs(face->descender); //face->bbox.xMax;
     font->layout->leading = -face->bbox.xMin;
     font->layout->kerningcount = 0;
     
@@ -224,7 +224,7 @@ SWFFONT* swf_LoadTrueTypeFont(char*filename)
 	    font->glyph[t].advance = ((bbox.xMax - bbox.xMin)*FT_SCALE)/FT_SUBPIXELS;
 	}
 #else
-	font->glyph[t].advance = glyph->advance.x/65536;
+	font->glyph[t].advance = glyph->advance.x*20/65536;
 #endif
 	
 	font->glyph[t].shape = swf_ShapeDrawerToShape(&draw);
@@ -392,7 +392,7 @@ SWFFONT* swf_LoadT1Font(char*filename)
 	draw.dealloc(&draw);
 	    
 	font->layout->bounds[c] = bbox;
-	font->glyph[c].advance = bbox.xmax/20;
+	font->glyph[c].advance = bbox.xmax;
 	if(!font->glyph[c].advance) {
 	    font->glyph[c].advance = firstx;
 	}