From 055893931716621bf4beee9be12e6aa7fdc7f22f Mon Sep 17 00:00:00 2001 From: Adrian Johnson Date: Mon, 9 Nov 2009 22:52:39 +1030 Subject: [PATCH] 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. --- poppler/CairoOutputDev.cc | 14 ++++++++++++++ 1 files changed, 14 insertions(+), 0 deletions(-) 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); -- 1.5.6.5