X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fgfxfont.c;h=45a44ca9afd455d6a981ea136ffb31343fcb1727;hb=191439ab6ffe1cad91825ae84286bf720370f863;hp=6ec1a4fc865af8e2f885ce0c1d7928a2c137c98b;hpb=796482f45946c67804ab2ca5f8b33a020d71a779;p=swftools.git diff --git a/lib/gfxfont.c b/lib/gfxfont.c index 6ec1a4f..45a44ca 100644 --- a/lib/gfxfont.c +++ b/lib/gfxfont.c @@ -136,7 +136,7 @@ static void glyph_clear(gfxglyph_t*g) static int errorno = 0; -gfxfont_t* gfxfont_load(char*filename, double quality) +gfxfont_t* gfxfont_load(char*id, char*filename, double quality) { FT_Face face; FT_Error error; @@ -164,7 +164,7 @@ gfxfont_t* gfxfont_load(char*filename, double quality) FT_Set_Pixel_Sizes (face, 16*loadfont_scale, 16*loadfont_scale); if(error) { - fprintf(stderr, "Couldn't load file %s- not a TTF file?\n", filename); + fprintf(stderr, "Couldn't load file %s- not a TTF file? (error=%02x)\n", filename, error); return 0; } if(face->num_glyphs <= 0) { @@ -179,6 +179,7 @@ gfxfont_t* gfxfont_load(char*filename, double quality) //font->leading = font->layout->ascent + font->layout->descent; //font->encoding = FONT_ENCODING_UNICODE; font->max_unicode = 0; + font->id = strdup(id); font->glyphs = rfx_calloc(face->num_glyphs*sizeof(gfxglyph_t)); glyph2unicode = rfx_calloc(face->num_glyphs*sizeof(int));