-static char mybuf[1024];
-static char* gfxstate2str(GfxState *state)
-{
- char*bufpos = mybuf;
- GfxRGB rgb;
- bufpos+=sprintf(bufpos,"CTM[%.3f/%.3f/%.3f/%.3f/%.3f/%.3f] ",
- state->getCTM()[0],
- state->getCTM()[1],
- state->getCTM()[2],
- state->getCTM()[3],
- state->getCTM()[4],
- state->getCTM()[5]);
- if(state->getX1()!=0.0)
- bufpos+=sprintf(bufpos,"X1-%.1f ",state->getX1());
- if(state->getY1()!=0.0)
- bufpos+=sprintf(bufpos,"Y1-%.1f ",state->getY1());
- bufpos+=sprintf(bufpos,"X2-%.1f ",state->getX2());
- bufpos+=sprintf(bufpos,"Y2-%.1f ",state->getY2());
- bufpos+=sprintf(bufpos,"PW%.1f ",state->getPageWidth());
- bufpos+=sprintf(bufpos,"PH%.1f ",state->getPageHeight());
- /*bufpos+=sprintf(bufpos,"FC[%.1f/%.1f] ",
- state->getFillColor()->c[0], state->getFillColor()->c[1]);
- bufpos+=sprintf(bufpos,"SC[%.1f/%.1f] ",
- state->getStrokeColor()->c[0], state->getFillColor()->c[1]);*/
-/* bufpos+=sprintf(bufpos,"FC[%.1f/%.1f/%.1f/%.1f/%.1f/%.1f/%.1f/%.1f]",
- state->getFillColor()->c[0], state->getFillColor()->c[1],
- state->getFillColor()->c[2], state->getFillColor()->c[3],
- state->getFillColor()->c[4], state->getFillColor()->c[5],
- state->getFillColor()->c[6], state->getFillColor()->c[7]);
- bufpos+=sprintf(bufpos,"SC[%.1f/%.1f/%.1f/%.1f/%.1f/%.1f/%.1f/%.1f]",
- state->getStrokeColor()->c[0], state->getFillColor()->c[1],
- state->getStrokeColor()->c[2], state->getFillColor()->c[3],
- state->getStrokeColor()->c[4], state->getFillColor()->c[5],
- state->getStrokeColor()->c[6], state->getFillColor()->c[7]);*/
- state->getFillRGB(&rgb);
- if(rgb.r || rgb.g || rgb.b)
- bufpos+=sprintf(bufpos,"FR[%.1f/%.1f/%.1f] ", rgb.r,rgb.g,rgb.b);
- state->getStrokeRGB(&rgb);
- if(rgb.r || rgb.g || rgb.b)
- bufpos+=sprintf(bufpos,"SR[%.1f/%.1f/%.1f] ", rgb.r,rgb.g,rgb.b);
- if(state->getFillColorSpace()->getNComps()>1)
- bufpos+=sprintf(bufpos,"CS[[%d]] ",state->getFillColorSpace()->getNComps());
- if(state->getStrokeColorSpace()->getNComps()>1)
- bufpos+=sprintf(bufpos,"SS[[%d]] ",state->getStrokeColorSpace()->getNComps());
- if(state->getFillPattern())
- bufpos+=sprintf(bufpos,"FP%08x ", state->getFillPattern());
- if(state->getStrokePattern())
- bufpos+=sprintf(bufpos,"SP%08x ", state->getStrokePattern());
-
- if(state->getFillOpacity()!=1.0)
- bufpos+=sprintf(bufpos,"FO%.1f ", state->getFillOpacity());
- if(state->getStrokeOpacity()!=1.0)
- bufpos+=sprintf(bufpos,"SO%.1f ", state->getStrokeOpacity());
-
- bufpos+=sprintf(bufpos,"LW%.1f ", state->getLineWidth());
-
- double * dash;
- int length;
- double start;
- state->getLineDash(&dash, &length, &start);
- int t;
- if(length)
- {
- bufpos+=sprintf(bufpos,"DASH%.1f[",start);
- for(t=0;t<length;t++) {
- bufpos+=sprintf(bufpos,"D%.1f",dash[t]);
- }
- bufpos+=sprintf(bufpos,"]");
- }
-
- if(state->getFlatness()!=1)
- bufpos+=sprintf(bufpos,"F%d ", state->getFlatness());
- if(state->getLineJoin()!=0)
- bufpos+=sprintf(bufpos,"J%d ", state->getLineJoin());
- if(state->getLineJoin()!=0)
- bufpos+=sprintf(bufpos,"C%d ", state->getLineCap());
- if(state->getLineJoin()!=0)
- bufpos+=sprintf(bufpos,"ML%d ", state->getMiterLimit());
-
- 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]);
- if(state->getCharSpace())
- bufpos+=sprintf(bufpos,"CS%.5f ", state->getCharSpace());
- if(state->getWordSpace())
- bufpos+=sprintf(bufpos,"WS%.5f ", state->getWordSpace());
- if(state->getHorizScaling()!=1.0)
- bufpos+=sprintf(bufpos,"SC%.1f ", state->getHorizScaling());
- if(state->getLeading())
- bufpos+=sprintf(bufpos,"L%.1f ", state->getLeading());
- if(state->getRise())
- bufpos+=sprintf(bufpos,"R%.1f ", state->getRise());
- if(state->getRender())
- bufpos+=sprintf(bufpos,"R%d ", state->getRender());
- bufpos+=sprintf(bufpos,"P%08x ", state->getPath());
- bufpos+=sprintf(bufpos,"CX%.1f ", state->getCurX());
- bufpos+=sprintf(bufpos,"CY%.1f ", state->getCurY());
- if(state->getLineX())
- bufpos+=sprintf(bufpos,"LX%.1f ", state->getLineX());
- if(state->getLineY())
- bufpos+=sprintf(bufpos,"LY%.1f ", state->getLineY());
- bufpos+=sprintf(bufpos," ");
- return mybuf;
-}
-
-static void dumpFontInfo(char*loglevel, GfxFont*font);