From: kramm Date: Mon, 2 Feb 2004 19:34:04 +0000 (+0000) Subject: fixed bug in font name setting X-Git-Tag: release-0-5-0~47 X-Git-Url: http://git.asbjorn.biz/?p=swftools.git;a=commitdiff_plain;h=e38d3a125e8bb4459e26cc4b42ee63f010c56ffb fixed bug in font name setting --- diff --git a/lib/modules/swffont.c b/lib/modules/swffont.c index ba0b66e..f2727a4 100644 --- a/lib/modules/swffont.c +++ b/lib/modules/swffont.c @@ -89,7 +89,7 @@ SWFFONT* swf_LoadTrueTypeFont(char*filename) { FT_Face face; FT_Error error; - const char* name; + const char* name = 0; FT_ULong charcode; FT_UInt gindex; SWFFONT* font; @@ -135,8 +135,9 @@ SWFFONT* swf_LoadTrueTypeFont(char*filename) font->layout->leading = -face->bbox.xMin; font->layout->kerningcount = 0; + name = FT_Get_Postscript_Name(face); if(name && *name) - font->name = (U8*)strdup(FT_Get_Postscript_Name(face)); + font->name = (U8*)strdup(name); /* // Map Glyphs to Unicode, version 1 (quick and dirty): int t;