X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fmodules%2Fswffont.c;h=e24d880993cc34769532e4a16a783f2fa4416498;hb=f1f20af550c019b3f21312bf971d4b06dbe8a49d;hp=f355829a883abd5f569bf38b10b9ed04cee81460;hpb=cf1c327737a887c027ae2669da0fb431cd866ee6;p=swftools.git diff --git a/lib/modules/swffont.c b/lib/modules/swffont.c index f355829..e24d880 100644 --- a/lib/modules/swffont.c +++ b/lib/modules/swffont.c @@ -130,9 +130,9 @@ SWFFONT* swf_LoadTrueTypeFont(char*filename) font->glyphnames = malloc(face->num_glyphs*sizeof(char*)); } - font->layout->ascent = face->ascender; //face->bbox.xMin; - font->layout->descent = face->descender; //face->bbox.xMax; - font->layout->leading = -face->bbox.xMin; + font->layout->ascent = face->ascender*20/FT_SUBPIXELS; //face->bbox.xMin; + font->layout->descent = abs(face->descender)*20/FT_SUBPIXELS; //face->bbox.xMax; + font->layout->leading = -face->bbox.xMin*20/FT_SUBPIXELS; font->layout->kerningcount = 0; name = FT_Get_Postscript_Name(face); @@ -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; } @@ -442,7 +442,7 @@ SWFFONT* swf_LoadFont(char*filename) #elif defined(HAVE_T1LIB) return swf_LoadT1Font(filename); #else - fprintf(stderr, "Error: Neither T1lib nor FreeType support compiled in. Could not load %s\n", infile); + fprintf(stderr, "Error: Neither T1lib nor FreeType support compiled in. Could not load %s\n", filename); return 0; #endif }