Reputation: 6786
(This is approaching this question from another angle.)
I am drawing maps. These can be seen as having three layers: At the bottom, there are solid colours representing things like forest and water, and low-contrast linework for things like “halos” on roads indicating classification. Then there is high-contrast linework, such as black lines representing road centrelines and black dotted lines representing paths. Finally, there are labels, usually black.
I would like the black lines to have gaps around the text, where the colours and lines of the bottom layer shines through.
In SVG, this can be done by setting a mask on the lines and drawing the text with a very wide stroke (to create the gap) into this mask.
Is there a way of expressing this in Postscript, short of writing my own font renderer to render “buffered” text as bézier paths? I can create a clip mask that goes right up to the edge of the text by drawing a rectangle around the page, charpath:ing the text and then doing eoclip, but how do I get the buffer?
Upvotes: 0
Views: 165
Reputation: 31199
PostScrtipt doesn't have any concept of transparency (modulo certain special cases like overprinting, imagemasks and chroma keyed images). There is also no standard way for a PostScript program to affect anything which has already been rendered, other than by drawing over it.
You can't 'get the buffer' if by that you mean get the pixels back from the page buffer in order to do your own compositing.
The only way I can see to do what you appear to want is to draw the black lines with the gaps already in place. Obviously this means moving the intelligence out of PostScript and putting it into your own application, you need to know, when you draw the black lines, where the text is going to be so that you can leave gaps in the lines in appropriate places.
Upvotes: 1