Commit ea6d9b97 authored by Jeff Muizelaar's avatar Jeff Muizelaar

2006-01-10 Jeff Muizelaar <jeff@infidigm.net>

	* poppler/CairoOutputDev.cc:
	* poppler/CairoOutputDev.h:
	Fix the following fixme in CairoOutputDevice.

	// FIXME: This is quite right yet, we need to accumulate all
	// glyphs within one text object before we clip.  Right now this
	// just add this one string.

	The fix uses a strategy similar to the one the Splash backend.
	textClipPath is used to store the appended path from each call to
	endString(). The accumulated path is clipped in endTextObject.
parent 9e8a655a
2006-01-10 Jeff Muizelaar <jeff@infidigm.net>
* poppler/CairoOutputDev.cc:
* poppler/CairoOutputDev.h:
Fix the following fixme in CairoOutputDevice.
// FIXME: This is quite right yet, we need to accumulate all
// glyphs within one text object before we clip. Right now this
// just add this one string.
The fix uses a strategy similar to the one the Splash backend.
textClipPath is used to store the appended path from each call to
endString(). The accumulated path is clipped in endTextObject.
2006-01-08 Jeff Muizelaar <jeff@infidigm.net>
* poppler/CairoOutputDev.cc: Don't try and load type3 fonts (#4030).
......
......@@ -57,6 +57,7 @@ CairoOutputDev::CairoOutputDev() {
stroke_pattern = NULL;
stroke_opacity = 1.0;
fill_opacity = 1.0;
textClipPath = NULL;
}
CairoOutputDev::~CairoOutputDev() {
......@@ -411,12 +412,22 @@ void CairoOutputDev::endString(GfxState *state)
// clip
if (render & 4) {
// FIXME: This is quite right yet, we need to accumulate all
// glyphs within one text object before we clip. Right now this
// just add this one string.
LOG (printf ("clip string\n"));
// append the glyph path to textClipPath.
// set textClipPath as the currentPath
if (textClipPath) {
cairo_append_path (cairo, textClipPath);
cairo_path_destroy (textClipPath);
}
// append the glyph path
cairo_glyph_path (cairo, glyphs, glyphCount);
cairo_clip (cairo);
// move the path back into textClipPath
// and clear the current path
textClipPath = cairo_copy_path (cairo);
cairo_new_path (cairo);
}
gfree (glyphs);
......@@ -440,6 +451,14 @@ void CairoOutputDev::type3D1(GfxState *state, double wx, double wy,
}
void CairoOutputDev::endTextObject(GfxState *state) {
if (textClipPath) {
// clip the accumulated text path
cairo_append_path (cairo, textClipPath);
cairo_clip (cairo);
cairo_path_destroy (textClipPath);
textClipPath = NULL;
}
}
......
......@@ -150,6 +150,7 @@ protected:
cairo_surface_t *surface;
cairo_glyph_t *glyphs;
int glyphCount;
cairo_path_t *textClipPath;
};
#endif
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