X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fmodules%2Fswffont.c;h=63ccc4f81dcc0245cb85fb08f3495e023275910b;hb=1603febdafc356d79bd59646fbdd141802952a4d;hp=6344fd3363d060c7687dc4fd17fff2910b3ad37a;hpb=8526dcf3a698c688e2cc4430ae106b5ecf70677f;p=swftools.git diff --git a/lib/modules/swffont.c b/lib/modules/swffont.c index 6344fd3..63ccc4f 100644 --- a/lib/modules/swffont.c +++ b/lib/modules/swffont.c @@ -51,6 +51,11 @@ void swf_SetLoadFontParameters(int _scale, int _skip_unused, int _full_unicode) #include #endif +/* Setting subpixels to 64 also means that the "point size" of the + font outlines will be 64. So the font, when rendered at original + size (i.e., the swf fontsize is 1024) will have the same size as + if it was rendered at 64pt */ + #define FT_SCALE 1 #define FT_SUBPIXELS 64 @@ -289,9 +294,9 @@ SWFFONT* swf_LoadTrueTypeFont(char*filename) #if 0 if(bbox.xMin > 0) { - font->glyph[font->numchars].advance = (bbox.xMax*FT_SCALE)/FT_SUBPIXELS; + font->glyph[font->numchars].advance = (bbox.xMax*20*FT_SCALE)/FT_SUBPIXELS; } else { - font->glyph[font->numchars].advance = ((bbox.xMax - bbox.xMin)*FT_SCALE)/FT_SUBPIXELS; + font->glyph[font->numchars].advance = ((bbox.xMax - bbox.xMin)*20*FT_SCALE)/FT_SUBPIXELS; } #else font->glyph[font->numchars].advance = glyph->advance.x*20/65536; @@ -471,7 +476,7 @@ SWFFONT* swf_LoadT1Font(char*filename) } last = pos; outline = outline->link; - printf("(%f,%f) ", pos.x, pos.y); + printf("t1lib: (%f,%f) ", pos.x, pos.y); } printf("\n");