Commit 448f03cf authored by Adrian Johnson's avatar Adrian Johnson Committed by Carlos Garcia Campos

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.
parent 3fead2a3
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment