- if ((state->getRender() & 3) != 3)
- {
- GfxFont*font = state->getFont();
- Gfx8BitFont*font8;
- if(font->isCIDFont()) {
- if(!ciderror)
- logf("<error> Not drawing CID Font characters!");
- ciderror++;
- return;
- }
- if(font->getType() == fontType3) {
- /* type 3 chars are passed primarily as graphics */
- return;
- }
- font8 = (Gfx8BitFont*)font;
-
- char**enc=font8->getEncoding();
-
- double x1,y1;
- x1 = x;
- y1 = y;
- state->transform(x, y, &x1, &y1);
-
- if(enc[c])
- swfoutput_drawchar(&output, x1, y1, enc[c], c);
- else
- logf("<warning> couldn't get name for character %02x from Encoding", c);
+ if ((state->getRender() & 3) == 3)
+ return;
+
+ GfxFont*font = state->getFont();
+
+ if(font->getType() == fontType3) {
+ /* type 3 chars are passed primarily as graphics */
+ return;
+ }
+ double x1,y1;
+ x1 = x;
+ y1 = y;
+ state->transform(x, y, &x1, &y1);
+
+ if(font->isCIDFont()) {
+ GfxCIDFont*cfont = (GfxCIDFont*)font;
+ Unicode u=0;
+ char*name=0;
+ if(_u)
+ u = *_u;
+ if(u) {
+ int t;
+ for(t=0;t<sizeof(nameToUnicodeTab)/sizeof(nameToUnicodeTab[0]);t++)
+ /* todo: should be precomputed */
+ if(nameToUnicodeTab[t].u == u) {
+ name = nameToUnicodeTab[t].name;
+ break;
+ }
+ }
+/* printf("%02x %04x/%04x-%d \"%s\" %s %d\n", c,u, *_u, uLen, name, cfont->getName()->getCString(),
+ cfont->getType());*/
+
+ if(name)
+ swfoutput_drawchar(&output, x1, y1, name, c);
+ else
+ logf("<warning> couldn't get name for CID character %02x from Encoding", c);
+ } else {
+ Gfx8BitFont*font8;
+ font8 = (Gfx8BitFont*)font;
+ char**enc=font8->getEncoding();
+
+ if(enc && enc[c])
+ swfoutput_drawchar(&output, x1, y1, enc[c], c);
+ else {
+ logf("<warning> couldn't get name for character %02x from Encoding", c);
+ }