if(lastx != chardata[t].x ||
lasty != chardata[t].y)
{
- newx=chardata[t].x;
- newy=chardata[t].y;
+ newx = chardata[t].x;
+ newy = chardata[t].y;
+ if(newx == 0)
+ newx = SET_TO_ZERO;
+ if(newy == 0)
+ newy = SET_TO_ZERO;
}
if(!colorcompare(&color, &chardata[t].color))
{
if(m->m11 != m->m22)
usefonts=0;
+ if(!font) {
+ msg("<warning> Font is NULL");
+ }
+
if(usefonts && ! drawonlyshapes)
{
int charid = font->getSWFCharID(character, charnr);
+ if(charid<0) {
+ msg("<warning> Didn't find %s in current charset (%s)",
+ FIXNULL(character),FIXNULL(font->getName()));
+ return;
+ }
if(shapeid>=0)
endshape();
if(textid<0)
this->fontid = strdup(name);
this->t1id = id;
- char**a= T1_GetAllCharNames(id);
+ char**charnamebase= T1_GetAllCharNames(id);
+ char**a= charnamebase;
int t, outlinepos=0;
char*map[256];
t=0;
while(*a)
{
- map[t] = *a;
+ map[t] = strdup(*a);
a++;
t++;
if(t==256 || !*a) {
int ret = T1_ReencodeFont(id, map);
if(ret)
fprintf(stderr,"Can't reencode font: (%s) ret:%d\n",filename, ret);
+ /* Deleting the font invalidates the charname array,
+ so we have to ask for it again now.
+ We continue at the position we were, hoping the font
+ didn't shrink in the meantime or something.
+ */
+ a = T1_GetAllCharNames(id) + (a - charnamebase);
}
// parsecharacters
this->charname[outlinepos] = strdup(name);
outlinepos++;
}
+
+ for(s=0;s<t;s++)
+ free(map[s]);
t=0;
}
}
return getSWFCharID(this->standardtable[charnr], -1);
}
msg("<warning> Didn't find character '%s' in font '%s'", FIXNULL(name), this->name);
- return 0;
+ return -1;
}
int SWFFont::getWidth(char*name)