[poppler] poppler/CairoOutputDev.cc

Carlos Garcia Campos carlosgc at kemper.freedesktop.org
Mon Nov 9 05:42:44 PST 2009


 poppler/CairoOutputDev.cc |   14 ++++++++++++++
 1 file changed, 14 insertions(+)

New commits:
commit 448f03cfc429d33bfa5527e3dc964ef5da10ee94
Author: Adrian Johnson <ajohnson at redneon.com>
Date:   Mon Nov 9 22:52:39 2009 +1030

    Don't render the color white in type 3 glyphs in the cairo backend
    
    PDF allows the "g" operator in Type 3 charprocs but cairo user fonts
    will render any stroke or fill in the font color.
    
    As the only PDFs I've seen with "g" in the charprocs are only using
    the gray values 0 or 1, a workaround is to disable strokes and fills
    of the charproc when the gray level is > 0.5.

diff --git a/poppler/CairoOutputDev.cc b/poppler/CairoOutputDev.cc
index 500583a..ec9aaa5 100644
--- a/poppler/CairoOutputDev.cc
+++ b/poppler/CairoOutputDev.cc
@@ -638,6 +638,13 @@ void CairoOutputDev::doPath(cairo_t *cairo, GfxState *state, GfxPath *path) {
 }
 
 void CairoOutputDev::stroke(GfxState *state) {
+  if (inType3Char) {
+      GfxGray gray;
+      state->getFillGray(&gray);
+      if (colToDbl(gray) > 0.5)
+	  return;
+  }
+
   doPath (cairo, state, state->getPath());
   cairo_set_source (cairo, stroke_pattern);
   LOG(printf ("stroke\n"));
@@ -649,6 +656,13 @@ void CairoOutputDev::stroke(GfxState *state) {
 }
 
 void CairoOutputDev::fill(GfxState *state) {
+  if (inType3Char) {
+      GfxGray gray;
+      state->getFillGray(&gray);
+      if (colToDbl(gray) > 0.5)
+	  return;
+  }
+
   doPath (cairo, state, state->getPath());
   cairo_set_fill_rule (cairo, CAIRO_FILL_RULE_WINDING);
   cairo_set_source (cairo, fill_pattern);


More information about the poppler mailing list