char* plus = strchr(fontname, '+');
if(plus && plus < &fontname[strlen(fontname)-1])
fontname = plus+1;
char* plus = strchr(fontname, '+');
if(plus && plus < &fontname[strlen(fontname)-1])
fontname = plus+1;
if(state->getLineJoin()!=0)
bufpos+=sprintf(bufpos,"ML%d ", state->getMiterLimit());
if(state->getLineJoin()!=0)
bufpos+=sprintf(bufpos,"ML%d ", state->getMiterLimit());
- if(state->getFont() && getFontName(state->getFont()))
- bufpos+=sprintf(bufpos,"F\"%s\" ",getFontName(state->getFont()));
+ if(state->getFont() && getFontID(state->getFont()))
+ bufpos+=sprintf(bufpos,"F\"%s\" ",getFontID(state->getFont()));
bufpos+=sprintf(bufpos,"FS%.1f ", state->getFontSize());
bufpos+=sprintf(bufpos,"MAT[%.1f/%.1f/%.1f/%.1f/%.1f/%.1f] ", state->getTextMat()[0],state->getTextMat()[1],state->getTextMat()[2],
state->getTextMat()[3],state->getTextMat()[4],state->getTextMat()[5]);
bufpos+=sprintf(bufpos,"FS%.1f ", state->getFontSize());
bufpos+=sprintf(bufpos,"MAT[%.1f/%.1f/%.1f/%.1f/%.1f/%.1f] ", state->getTextMat()[0],state->getTextMat()[1],state->getTextMat()[2],
state->getTextMat()[3],state->getTextMat()[4],state->getTextMat()[5]);
Ref* r=font->getID();
msg("%s=========== %s (ID:%d,%d) ==========\n", loglevel, name, r->num,r->gen);
Ref* r=font->getID();
msg("%s=========== %s (ID:%d,%d) ==========\n", loglevel, name, r->num,r->gen);
- msg("<debug> drawChar(%f,%f,c='%c' (%d),u=%d <%d>) CID=%d name=\"%s\"\n",x1,y1,(c&127)>=32?c:'?',c,u, uLen, font->isCIDFont(), FIXNULL(name));
+ msg("<debug> drawChar(%f,%f,c='%c' (%d),u=%d <%d>) CID=%d name=\"%s\"\n",x,y,(c&127)>=32?c:'?',c,u, uLen, font->isCIDFont(), FIXNULL(name));
int ret = swfoutput_drawchar(&output, x1, y1, name, c, u);
}
int ret = swfoutput_drawchar(&output, x1, y1, name, c, u);
}
+
+ /*if(font->isCIDFont()) {
+ GfxCIDFont* cidFont = (GfxCIDFont *)font;
+ GString c = cidFont->getCollection();
+ msg("<notice> Collection: %s", c.getCString());
+ }*/
+
if (font->getType() == fontType1C ||
font->getType() == fontCIDType0C) {
if (!(fontBuf = font->readEmbFontFile(xref, &fontLen))) {
if (font->getType() == fontType1C ||
font->getType() == fontCIDType0C) {
if (!(fontBuf = font->readEmbFontFile(xref, &fontLen))) {
int t;
/* first, look if we substituted this font before-
this way, we don't initialize the T1 Fonts
too often */
for(t=0;t<substitutepos;t++) {
int t;
/* first, look if we substituted this font before-
this way, we don't initialize the T1 Fonts
too often */
for(t=0;t<substitutepos;t++) {
- if(!strcmp(fontname, substitutesource[t])) {
- fontname = substitutetarget[t];
+ if(!strcmp(fontid, substitutesource[t])) {
+ fontid = substitutetarget[t];
break;
}
}
/* second, see if swfoutput already has this font
cached- if so, we are done */
break;
}
}
/* second, see if swfoutput already has this font
cached- if so, we are done */
fileName = searchFont(fontname);
if(!fileName) showFontError(gfxFont,0);
}
if(!fileName) {
fileName = searchFont(fontname);
if(!fileName) showFontError(gfxFont,0);
}
if(!fileName) {
msg("<warning> Font %s could not be loaded.", fontname);
msg("<warning> Try putting a TTF version of that font (named \"%s.ttf\") into /swftools/fonts", fontname);
msg("<warning> Font %s could not be loaded.", fontname);
msg("<warning> Try putting a TTF version of that font (named \"%s.ttf\") into /swftools/fonts", fontname);