When rendering Type 3 glyphs that contain stroke operations, Poppler will
render the stroke in the current stroke color instead of the fill color.
The PDF Reference states that the text rendering mode parameter which allows
fonts to be stroked and filled separately with the stroke and fill colors
does not apply to Type 3 fonts. Adobe Reader renders Type 3 glyphs
that contain stroke operations with the fill color.
Attached is a patch that fixes this bug.
>From b8f89cb5ba46081fe77be79924d59c8e42c66627 Mon Sep 17 00:00:00 2001
From: Adrian Johnson <[EMAIL PROTECTED]>
Date: Sun, 1 Jun 2008 00:44:19 +0930
Subject: [PATCH] Ensure only fill color is used in type 3 glyphs
Previously Type 3 glyphs that contain stroke operations for stroking
the lines with the stroke color.
---
poppler/Gfx.cc | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/poppler/Gfx.cc b/poppler/Gfx.cc
index 6fc9b8d..019c682 100644
--- a/poppler/Gfx.cc
+++ b/poppler/Gfx.cc
@@ -3276,6 +3276,7 @@ void Gfx::doShowText(GooString *s) {
Parser *oldParser;
char *p;
int len, n, uLen, nChars, nSpaces, i;
+ GfxColor *stroke_color;
font = state->getFont();
wMode = font->getWMode();
@@ -3330,6 +3331,9 @@ void Gfx::doShowText(GooString *s) {
state->setCTM(newCTM[0], newCTM[1], newCTM[2], newCTM[3], x, y);
//~ the CTM concat values here are wrong (but never used)
out->updateCTM(state, 1, 0, 0, 1, 0, 0);
+ stroke_color = state->getStrokeColor();
+ state->setStrokeColor(state->getFillColor());
+ out->updateStrokeColor(state);
if (!out->beginType3Char(state, curX + riseX, curY + riseY, tdx, tdy,
code, u, uLen)) {
((Gfx8BitFont *)font)->getCharProc(code, &charProc);
@@ -3347,6 +3351,7 @@ void Gfx::doShowText(GooString *s) {
}
charProc.free();
}
+ state->setStrokeColor(stroke_color);
restoreState();
// GfxState::restore() does *not* restore the current position,
// so we deal with it here using (curX, curY) and (lineX, lineY)
--
1.5.2.4
_______________________________________________
poppler mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/poppler