/* config */
static double caplinewidth = 3.0;
-static int zoom = 72; /* xpdf: 86 */
+static double zoom = 72; /* xpdf: 86 */
static int forceType0Fonts = 1;
static void printInfoString(Dict *infoDict, char *key, char *fmt);
int user_clipx1,user_clipx2,user_clipy1,user_clipy2;
gfxline_t* current_text_stroke;
+ gfxline_t* current_text_clip;
char* current_font_id;
gfxfont_t* current_gfxfont;
gfxmatrix_t current_font_matrix;
user_clipx2 = 0;
user_clipy2 = 0;
current_text_stroke = 0;
+ current_text_clip = 0;
fontlist = 0;
memset(&output, 0, sizeof(output));
// printf("SWFOutputDev::SWFOutputDev() \n");
double * ldash = 0;
state->getLineDash(&ldash, &dashnum, &dashphase);
+ gfxline_t*line2 = 0;
+
if(dashnum && ldash) {
float * dash = (float*)malloc(sizeof(float)*(dashnum+1));
int t;
dump_outline(line);
}
- gfxline_t*line2 = gfxtool_dash_line(line, dash, dashphase);
- gfxline_free(line);
+ line2 = gfxtool_dash_line(line, dash, dashphase);
line = line2;
msg("<trace> After dashing:");
}
}
swfoutput_drawgfxline(&output, line, width, &col, capType, joinType, miterLimit);
+
+ if(line2)
+ gfxline_free(line2);
}
gfxcolor_t getFillColor(GfxState * state)
void SWFOutputDev::beginString(GfxState *state, GString *s)
{
int render = state->getRender();
- if(current_text_stroke)
+ if(current_text_stroke) {
msg("<error> Error: Incompatible change of text rendering to %d while inside cliptext", render);
+ }
msg("<trace> beginString(%s) render=%d", makeStringPrintable(s->getCString()), render);
double m11,m21,m12,m22;
gfxline_t*glyph = current_gfxfont->glyphs[charid].line;
gfxline_t*tglyph = gfxline_clone(glyph);
gfxline_transform(tglyph, &m);
- current_text_stroke = gfxline_append(current_text_stroke, tglyph);
+ if((render&3) != RENDER_INVISIBLE) {
+ gfxline_t*add = gfxline_clone(tglyph);
+ current_text_stroke = gfxline_append(current_text_stroke, add);
+ }
+ if(render&RENDER_CLIP) {
+ gfxline_t*add = gfxline_clone(tglyph);
+ current_text_clip = gfxline_append(current_text_clip, add);
+ }
+ gfxline_free(tglyph);
}
}
now (as there may be texts of other rendering modes in this
text object)- clipping objects have to wait until endTextObject,
however */
- if(render == RENDER_FILLSTROKE) {
+ if((render&3) == RENDER_FILL) {
+ fillGfxLine(state, current_text_stroke);
+ gfxline_free(current_text_stroke);
+ current_text_stroke = 0;
+ } else if((render&3) == RENDER_FILLSTROKE) {
fillGfxLine(state, current_text_stroke);
strokeGfxline(state, current_text_stroke);
gfxline_free(current_text_stroke);
current_text_stroke = 0;
- } else if(render == RENDER_STROKE) {
+ } else if((render&3) == RENDER_STROKE) {
strokeGfxline(state, current_text_stroke);
gfxline_free(current_text_stroke);
current_text_stroke = 0;
void SWFOutputDev::endTextObject(GfxState *state)
{
int render = state->getRender();
- msg("<trace> endTextObject() render=%d textstroke=%08x", render, current_text_stroke);
+ msg("<trace> endTextObject() render=%d textstroke=%08x clipstroke=%08x", render, current_text_stroke, current_text_clip);
if(states[statepos].textRender != render)
msg("<error> Internal error: drawChar.render!=beginString.render");
- if(current_text_stroke) {
- if((render&3) == RENDER_FILL || (render&3) == RENDER_FILLSTROKE) {
- fillGfxLine(state, current_text_stroke);
- }
- if((render&3) == RENDER_STROKE || (render&3) == RENDER_FILLSTROKE) {
- strokeGfxline(state, current_text_stroke);
- }
- if((render&4) == RENDER_CLIP) {
- clipToGfxLine(state, current_text_stroke);
- }
- gfxline_free(current_text_stroke);
- current_text_stroke = 0;
+ if(current_text_clip) {
+ clipToGfxLine(state, current_text_clip);
+ gfxline_free(current_text_clip);
+ current_text_clip = 0;
}
}
msg("<notice> Collection: %s", c.getCString());
}*/
- if (font->getType() == fontType1C) {
+ //if (font->getType() == fontType1C) {
+ if (0) { //font->getType() == fontType1C) {
if (!(fontBuf = font->readEmbFontFile(xref, &fontLen))) {
fclose(f);
msg("<error> Couldn't read embedded font file");
caplinewidth = atof(value);
} else if(!strcmp(name, "zoom")) {
char buf[80];
- zoom = atoi(value);
+ zoom = atof(value);
sprintf(buf, "%f", (double)jpeg_dpi/(double)zoom);
swfoutput_setparameter("jpegsubpixels", buf);
sprintf(buf, "%f", (double)ppm_dpi/(double)zoom);