[Poppler-bugs] [Bug 27482] Colorizing text and masks in pattern colorspace

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Fri Apr 9 02:22:40 PDT 2010


https://bugs.freedesktop.org/show_bug.cgi?id=27482

--- Comment #5 from thomasf <Thomas.Freitag at alfa.de> 2010-04-09 02:22:40 PDT ---
(In reply to comment #4)

I think I need to clearify how colorizing text with pattern colorspace is
working:

1. If I encounter when starting text (BT command) or changing colorspace inside
a BT/ET bracket, I stop painting text itself but set rendering mode to use text
as clipping path in the output device. To restore the former state when ending
this behaviour I call saveState i.e. in SplashOutputDev::beginTextObject
2. From this time on, all text displaying in the output device is suspended,
instead of it text clipping path is extended.
3. In this state, when coming to an ET or when changing colorspace back to a
"normal" colorspace i.e. with opSetFillColorSpace or opSetFillCMYKColor or
simular, the actual text clipping path need first to be filled with private
Gfx::doPatternFill before restoring the state saved in 1. If we omit saveState
in 1, the text clipping path will remain active, because saveState/restoreState
in doPatternFill of course restore the text clipping path, isn't it?

To hide the restoreState from Gfx.cc and do it i.e. in the output device (keep
in mind that we stll need the text clipping path) in´the endTextObject in the
output device, we would need the doPatternFill available in endTextObject. This
would make it clearer, but would need much more changes in code. And please
keep in mind, that this behaviour (calling out->restoreState without matching
out->saveState in Gfx.cc but with matching saveState in
SplashOutputDev::beginTextObject, I don't mean that this makes it more
understandable, but at least it seems to work) was already introduced in the
patch of bug 19670, this patch just complete that behaviour where it is
missing.
If You have any better idea to make it more understandable, I would have no
pain to redesign and test it once again :-)

What I redesigned in this patch, was colorizing image masks with pattern
colorspace in SplashOutputDev.cc, because the old using softmasks doesn't work
with http://www.alfa.de/2285316_1_4.pdf.

Regarding cairo output: I never compiled it and therefore never tested it
'cause I have no test case for it, but in my opinion simply drawing the image
mask will loose the black shadow of the white text in
http://www.alfa.de/2285316_1_4.pdf (because the image mask will just paint
white color, the black shadow comes from the pattern colorspace), and it should
give incredibal results with
http://www.alfa.de/de/admin/content/document/PDF/cafebarspielsalon_26022009_01.pdf
from bug 19994 where I introduced colorizing image masks with pattern
colorspace.

Hoply this comments make the things clearer.

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the Poppler-bugs mailing list