diff options
author | Adrian Johnson <ajohnson@redneon.com> | 2009-11-09 22:52:39 +1030 |
---|---|---|
committer | Carlos Garcia Campos <carlosgc@gnome.org> | 2009-11-09 14:37:59 +0100 |
commit | 448f03cfc429d33bfa5527e3dc964ef5da10ee94 (patch) | |
tree | 44d4f7c52e91a72441e9838d063337fa4ad4da44 | |
parent | 3fead2a3b53681ef95116f18f17f1a9febec6e48 (diff) |
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.
-rw-r--r-- | poppler/CairoOutputDev.cc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/poppler/CairoOutputDev.cc b/poppler/CairoOutputDev.cc index 500583a9..ec9aaa58 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); |