X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=pdf2swf%2Fswfoutput.cc;h=b4c1229fb72b06b20cb54b61353d35cbab8853b5;hb=3879a8dc472680123cd6c3dd21c0e7002186fd08;hp=ea6ae37a10e6e6c87fb5e1205ea5d1fdb8f61630;hpb=c39317f9bd23dbc12a8ade934edbcf17952b087e;p=swftools.git diff --git a/pdf2swf/swfoutput.cc b/pdf2swf/swfoutput.cc index ea6ae37..b4c1229 100644 --- a/pdf2swf/swfoutput.cc +++ b/pdf2swf/swfoutput.cc @@ -1001,8 +1001,10 @@ struct fontlist_t fontlist_t*next; } *fontlist = 0; -/* TODO: why don't higher values (64, 1024) work here? */ -#define FONT_INTERNAL_SIZE 16 +/* Notice: we can only put chars in the range -1639,1638 (-32768/20,32768/20). + So if we set this value to high, the char coordinates will overflow. + If we set it to low, however, the char positions will be inaccurate */ +#define FONT_INTERNAL_SIZE 4 /* process a character. */ static int drawchar(struct swfoutput*obj, SWFFONT *swffont, char*character, int charnr, int u, swfmatrix*m) @@ -1142,6 +1144,7 @@ int getCharID(SWFFONT *font, int charnr, char *charname, int u) if(charname) { for(t=0;tnumchars;t++) { if(font->glyphnames[t] && !strcmp(font->glyphnames[t],charname)) { + msg(" Char [%d,>%s<,%d] maps to %d\n", charnr, charname, u, t); return t; } } @@ -1149,6 +1152,7 @@ int getCharID(SWFFONT *font, int charnr, char *charname, int u) we can find the capitalized version */ for(t=0;tnumchars;t++) { if(font->glyphnames[t] && !strcasecmp(font->glyphnames[t],charname)) { + msg(" Char [%d,>>%s<<,%d] maps to %d\n", charnr, charname, u, t); return t; } } @@ -1157,11 +1161,13 @@ int getCharID(SWFFONT *font, int charnr, char *charname, int u) if(u>0) { /* try to use the unicode id */ if(u>=0 && umaxascii && font->ascii2glyph[u]>=0) { + msg(" Char [%d,%s,>%d<] maps to %d\n", charnr, charname, u, font->ascii2glyph[u]); return font->ascii2glyph[u]; } } if(charnr>=0 && charnrnumchars) { + msg(" Char [>%d<,%s,%d] maps to %d\n", charnr, charname, u, charnr); return charnr; } @@ -1170,6 +1176,7 @@ int getCharID(SWFFONT *font, int charnr, char *charname, int u) is US-ASCII based. It's needed for fonts which return broken unicode indices */ if(charnr>=0 && charnrmaxascii && font->ascii2glyph[charnr]>=0) { + msg(" Char [>%d<,%s,%d] maps to %d\n", charnr, charname, u, font->ascii2glyph[charnr]); return font->ascii2glyph[charnr]; } }