For Programmers: Free Programming Magazines  


Home > Archive > PostScript > January 2006 > string bool charpath









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author string bool charpath
Roger Willcocks

2006-01-09, 9:30 pm

PLRM III tells us [charpath] "The /bool/ operand determines what happens of
the glyph path is designed to be stroked rather than filled or outlined."

But PaintType 1 (stroked) is 'no longer supported' (PLRM III p. 326), and
PaintType 2 is 'designed to be filled' - so should the boolean operator to
charpath have any effect any more?

--
Roger



Ken Sharp

2006-01-09, 9:30 pm

In article <doc4a8$4qu$1$8300dec7@news.demon.co.uk>, rkww@rops.org
says...
> PLRM III tells us [charpath] "The /bool/ operand determines what happens of
> the glyph path is designed to be stroked rather than filled or outlined."
>
> But PaintType 1 (stroked) is 'no longer supported' (PLRM III p. 326), and
> PaintType 2 is 'designed to be filled' - so should the boolean operator to
> charpath have any effect any more?


The PLRM actually says PaintType 2 is 'Glyph outlines (designed to be
filled) are stroked'.

That is, the glyph outline was intended for filling, but is stroked
instead.

I seee no conflict in any event. Even if you couldn't declare a font as
'stroked', there is no reason why you can't still have an operator which
strokes the path defined by the glyph outline, which is what 'charpath
stroke' does.


Ken
rkww

2006-01-09, 9:30 pm

Ken Sharp wrote:
> In article <doc4a8$4qu$1$8300dec7@news.demon.co.uk>, rkww@rops.org
> says...
>
> The PLRM actually says PaintType 2 is 'Glyph outlines (designed to be
> filled) are stroked'.
>
> That is, the glyph outline was intended for filling, but is stroked
> instead.
>
> I seee no conflict in any event. Even if you couldn't declare a font as
> 'stroked', there is no reason why you can't still have an operator which
> strokes the path defined by the glyph outline, which is what 'charpath
> stroke' does.


As I understand it the argument to charpath is there to handle the
original Courier font which was made from open stroked paths rather
than closed regions. 'show' should call 'stroke' (or 'strokepath fill')
in this case, so charpath needed to call 'strokepath' to generate an
appropriate character outline. But all fonts these days are closed
regions, which can be filled or outlined.

So to rephrase my question, what determines (within charpath) whether a
glyph path is 'designed to be stroked' if the only options for
PaintType are zero - 'glyph outlines are filled' and two - 'glyph
outlines (designed to be filled) are stroked'.

Or should 'true charpath' always automatically call strokepath on the
resulting path, regardless of the PaintType?

--
Roger

Ken Sharp

2006-01-09, 9:30 pm

In article <1135268381.915824.273570@f14g2000cwb.googlegroups.com>,
roger@rops.org says...

> As I understand it the argument to charpath is there to handle the
> original Courier font which was made from open stroked paths rather
> than closed regions.


I don't think so. charpath is there for a number of reasons, it allows
the PostScript programmer to do all sorts of things with the path which
results form a series of glyphs. For instance one can create clip path
from text which allows an underlying image to show through, or to
'punch' text out of an image, or all sorts of other exciting effects.

The path resulting from charpath need not be stroked.

I don't recall the original Courier being defined that way either, but
that was a long time ago.


> in this case, so charpath needed to call 'strokepath' to generate an
> appropriate character outline.


You could be correct, I don't recall that being the case, and its a
pretty ugly way to define a font, but its possible.


> But all fonts these days are closed
> regions, which can be filled or outlined.


Ha! If only it were so....


> So to rephrase my question, what determines (within charpath) whether a
> glyph path is 'designed to be stroked' if the only options for
> PaintType are zero - 'glyph outlines are filled' and two - 'glyph
> outlines (designed to be filled) are stroked'.


I think the point Adobe are trying to get across is that a font
shouldn't be designed to be stroked. If you want an 'outline' font, then
you should design it so that the 'outlines' are filled, not stroked.

The point of PaintType 1 was that the glyph machinery would take
differnet action when the font had a 'stroke' type. This is no longer
the case (in fact I thnkn that was deprecated with level 2).

> Or should 'true charpath' always automatically call strokepath on the
> resulting path, regardless of the PaintType?


I think there is some confusion in teh manual here. Although the entry
for charpath talks about bool affecting what happens if the glyph is
*designed* to be stroked rahter than filled, I think it means if the
intention of the PostScript programmer is to stroke the path or fill it.

IIRC this is due to the way that paths are scan-converted, one of the
Genoa tests is designed to show the problem, by calling true charpath
and then calling stroke. The curves of the glyph exhibit 'railway
tracks' which are caused by the sub-path generation of charpath.

At least, HP and Adobe printers do this, Jaws does it differently and we
keep getting people complaining because our result doesn't match (is
better!) than the reference....


Ken
Roger Willcocks

2006-01-09, 9:30 pm

"Ken Sharp" <ken@spamcop.net> wrote in message
news:MPG.1e14eaee3c6ed4df989870@news.eclipse.co.uk...
> In article <1135268381.915824.273570@f14g2000cwb.googlegroups.com>,
> roger@rops.org says...
>
>
> I don't think so. charpath is there for a number of reasons, it allows
> the PostScript programmer to do all sorts of things with the path which
> results form a series of glyphs. For instance one can create clip path
> from text which allows an underlying image to show through, or to
> 'punch' text out of an image, or all sorts of other exciting effects.
>



Indeed, but my comment was about the [boolean] argument to charpath, not
charpath itself.

>
> I think there is some confusion in teh manual here. Although the entry
> for charpath talks about bool affecting what happens if the glyph is
> *designed* to be stroked rahter than filled, I think it means if the
> intention of the PostScript programmer is to stroke the path or fill it.


Fair enough. There's an obvious parallel with normal 'show' - PaintType zero
indicates characters to be filled, while PaintType 2 indicates they should
be stroked with a StrokeWidth-wide pen.

And (it's finally dawned on me) 'charpath' has to invoke 'strokepath' itself
because the StrokeWidth parameter is specified in the character coordinate
system.

--
Roger


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com