- pos2 = tag->len;
- swf_SetU16(tag, 0); //fontcode-fontoffset
- for(t=0;t<f->numchars;t++) {
- tag->data[pos + t*2] = (tag->len-pos);
- tag->data[pos + t*2 + 1] = (tag->len-pos) >> 8;
- swf_SetSimpleShape(tag, f->glyph[t].shape);
+
+ for(t=0;t<=f->numchars;t++) {
+ if(flags&8) {
+ tag->data[pos + t*4 ] = (tag->len-pos);
+ tag->data[pos + t*4 + 1] = (tag->len-pos) >> 8;
+ tag->data[pos + t*4 + 2] = (tag->len-pos) >> 16;
+ tag->data[pos + t*4 + 3] = (tag->len-pos) >> 24;
+ } else {
+ if(tag->len - pos > 65535) {
+ fprintf(stderr, "Internal error: Font too big and WideOffsets flag not set\n");
+ exit(1);
+ }
+ tag->data[pos + t*2 ] = (tag->len-pos);
+ tag->data[pos + t*2 + 1] = (tag->len-pos) >> 8;
+ }
+ if(t<f->numchars)
+ swf_SetSimpleShape(tag, f->glyph[t].shape);