[PATCH] Ensure only fill color is used in type 3 glyphs

Adrian Johnson ajohnson at redneon.com
Sat May 31 08:14:19 PDT 2008


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


--------------090809010007050404050205--


More information about the poppler mailing list