X-Git-Url: http://git.asbjorn.biz/?p=swftools.git;a=blobdiff_plain;f=lib%2Fgfxfont.c;h=a310bfa38833e04d8af5b29f10800bcf56aec9f5;hp=e6f96cbe26b86641d0fd5bc54a2a34f9c097ba8c;hb=22aff003c999ce595128ce66ab4c5369b0b515c2;hpb=fc713269e9d26d1be92f70e1ff0d508c94a65dba diff --git a/lib/gfxfont.c b/lib/gfxfont.c index e6f96cb..a310bfa 100644 --- a/lib/gfxfont.c +++ b/lib/gfxfont.c @@ -557,7 +557,22 @@ void gfxfont_fix_unicode(gfxfont_t*font) max = u; } free(used); - + if(font->unicode2glyph) { + free(font->unicode2glyph); + } + font->unicode2glyph = 0; + font->max_unicode = 0; +} + +void gfxfont_add_unicode2glyph(gfxfont_t*font) +{ + int t; + int max = 0; + for(t=0;tnum_glyphs;t++) { + int u = font->glyphs[t].unicode; + if(u > max) + max = u; + } if(!font->unicode2glyph) { /* (re)generate unicode2glyph-to-glyph mapping table by reverse mapping the glyph unicode2glyph's indexes into the mapping table. For collisions,