From: kramm Date: Fri, 22 Mar 2002 17:29:00 +0000 (+0000) Subject: * added support for font layout X-Git-Tag: xpdf-0-92~57 X-Git-Url: http://git.asbjorn.it/?a=commitdiff_plain;h=3a152402b038f1dc1795206d18c3469e636a8b68;p=swftools.git * added support for font layout * font->flags is now font->encoding, font->style --- diff --git a/lib/example/dumpfont.c b/lib/example/dumpfont.c index 1481ed6..0011937 100644 --- a/lib/example/dumpfont.c +++ b/lib/example/dumpfont.c @@ -62,13 +62,24 @@ void DumpFont(SWFFONT * f,char * name) printf(" f->id = id;\n"); printf(" f->version = %d;\n", f->version); printf(" f->name = strdup(\"%s\");\n",f->name); - printf(" f->flags = 0x%02x;\n",f->flags); + printf(" f->style = 0x%02x;\n",f->style); + printf(" f->encoding = 0x%02x;\n",f->encoding); printf(" f->numchars = %d;\n",f->numchars); printf(" f->maxascii = %d;\n",f->maxascii); printf(" f->glyph = (SWFGLYPH*)malloc(sizeof(SWFGLYPH)*%d);\n",f->numchars); printf(" f->glyph2ascii = (U16*)malloc(sizeof(U16)*%d);\n",f->numchars); printf(" f->ascii2glyph = (int*)malloc(sizeof(int)*%d);\n",f->maxascii); printf(" memset(f->ascii2glyph, -1, sizeof(int)*%d);\n\n", f->maxascii); + if(f->layout) { + printf(" f->layout = (SWFLAYOUT*)malloc(sizeof(SWFLAYOUT));"); + printf(" f->layout->ascent = %d;", f->layout->ascent); + printf(" f->layout->descent = %d;", f->layout->descent); + printf(" f->layout->leading = %d;", f->layout->leading); + printf(" f->layout->kerningcount = 0;"); + printf(" f->layout->kerning = 0;"); + printf(" f->layout->bounds = (SRECT*)malloc(sizeof(SRECT)*%d);", f->numchars); + printf(" memset(f->layout->bounds, 0, malloc(sizeof(SRECT)*%d));", f->numchars); + } for (i=0;inumchars;i++) if (f->glyph[i].shape)