diff -ur -x'*.o' ../cvs/swftools/lib/modules/swftext.c ./lib/modules/swftext.c --- ../cvs/swftools/lib/modules/swftext.c 2008-05-23 18:52:04.570873000 +0200 +++ ./lib/modules/swftext.c 2008-05-23 20:34:18.492881000 +0200 @@ -801,6 +801,7 @@ f->use->is_reduced = 0; f->use->used_glyphs = 0; f->use->chars = (int*)rfx_calloc(sizeof(f->use->chars[0]) * f->numchars); + f->use->glyphs_specified = 0; return 0; } diff -ur -x'*.o' ../cvs/swftools/lib/rfxswf.h ./lib/rfxswf.h --- ../cvs/swftools/lib/rfxswf.h 2008-04-08 07:09:56.569894000 +0200 +++ ./lib/rfxswf.h 2008-05-23 20:34:19.642898000 +0200 @@ -501,6 +501,7 @@ { int* chars; char is_reduced; int used_glyphs; + int glyphs_specified; } FONTUSAGE; #define FONT_STYLE_BOLD 1 diff -ur -x'*.o' ../cvs/swftools/src/swfc.c ./src/swfc.c --- ../cvs/swftools/src/swfc.c 2008-05-23 18:52:05.290884000 +0200 +++ ./src/swfc.c 2008-05-24 11:50:38.537568000 +0200 @@ -979,7 +979,7 @@ swf_FoldSprite(tag); if(stack[stackpos].scalegrid.xmin | stack[stackpos].scalegrid.ymin | - stack[stackpos].scalegrid.xmax | stack[stackpos].scalegrid.ymax) + stack[stackpos].scalegrid.xmax | stack[stackpos].scalegrid.ymax) { tag = swf_InsertTag(tag, ST_DEFINESCALINGGRID); swf_SetU16(tag, stack[stackpos].id); @@ -1546,7 +1546,7 @@ swf_FontCreateLayout(font); } font->id = id; - swf_FontReduce_swfc(font); + swf_FontReduce_swfc(font); tag = swf_InsertTag(tag, ST_DEFINEFONT2); swf_FontSetDefine2(tag, font); tag = swf_InsertTag(tag, ST_EXPORTASSETS); @@ -2427,7 +2427,7 @@ v = parseRawTwip(lastpos); } *p = save; - if(ex == '+') + if(ex == '+') val += v; else if(ex == '-') val -= v; @@ -3028,7 +3028,7 @@ { char*name = lu(args, "name"); char*value = lu(args, "value"); - + if(!defines_initialized) { dictionary_init(&defines); mem_init(&define_values); @@ -4289,6 +4289,7 @@ map_t args; char* fontfile; int nr = -1; + U8* glyphs_to_include; msg(" analyse Command: %s (line %d)", command, line); for(t=0;tuse->glyphs_specified = 1; + } + else + { + if (strcmp (glyphs_to_include, "")) + { + swf_FontUseUTF8(font, glyphs_to_include); + font->use->glyphs_specified = 1; + } + else + swf_FontInitUsage(font); + } + } dictionary_put2(&fonts, name, font); } else @@ -4328,10 +4347,16 @@ if (!font) syntaxerror("font %s is not known in line %d", lu(&args, "font"), line); else - if (!strcmp(command, "edittext")) - swf_FontUseAll(font); - else - swf_FontUseUTF8(font, lu(&args, "text")); + if (font->use && !font->use->glyphs_specified) + { + if (!strcmp(command, "edittext")) + { + swf_FontUseAll(font); + font->use->glyphs_specified = 1; + } + else + swf_FontUseUTF8(font, lu(&args, "text")); + } } map_clear(&args); return;