Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Adobe bug with charpath and clip

65 views
Skip to first unread message

jdaw1

unread,
Jan 4, 2009, 11:02:13 PM1/4/09
to
The following contains a comment. It works correctly as-is under
GhostScript; but not under Mac Distiller 8.1.3 (10/23/06). However, de-
commenting the comment causes it to work.

The trouble is that the commented code contains pathforall, so won't
work if the font is protected. Do any readers know a work-around?

%!

1 setlinejoin 1 setlinecap [] 0 setdash newpath

gsave
/TimesNewRomanPS-BoldMT 96 selectfont 50 500 moveto (F70) true
charpath
% [ {/moveto cvx} {/lineto cvx} {/curveto cvx} {/closepath cvx}
pathforall ] cvx newpath exec
clip

24 -4 1.99
{
dup 2 sub exch
setlinewidth 1 setgray gsave stroke grestore
setlinewidth 0 setgray gsave stroke grestore
} for
grestore

showpage

jdaw1

unread,
Jan 4, 2009, 11:14:52 PM1/4/09
to
Wrapping, eh? The comment in the above code consists of the next
paragraph:

% [ {/moveto cvx} {/lineto cvx} {/curveto cvx} {/closepath cvx}
pathforall ] cvx newpath exec

Of course, it could be replaced with the next paragraph, which would
help in some situations:

{[ {/moveto cvx} {/lineto cvx} {/curveto cvx} {/closepath cvx}
pathforall ] cvx newpath exec} stopped pop

jdaw1

unread,
Jan 5, 2009, 9:46:52 AM1/5/09
to
Even more robust pathification of the charpath might resemble:

/ClearToHere {[ {/moveto cvx} {/lineto cvx} {/curveto cvx} {/closepath
cvx} pathforall ] cvx newpath exec} stopped pop {/ClearToHere eq
{exit} if} loop

Dave

unread,
Jan 7, 2009, 2:29:36 PM1/7/09
to

Interesting bug. The clip seems to be ignored (by Windows Distiller
9.0) but it is honored by Ghostscript.
There a couple ways to work aound this without using pathforall.
Changing the line 'clip' to 'clip newpath clippath' will fix the
clipping problem but then you may find the interior paths inside the
glyph outline are not the same (though you may like the patterns).

The other way, more brute force, is to call 'newpath' after 'clip' and
then repeat the charpath:

/TimesNewRomanPS-BoldMT 96 selectfont 50 500 moveto (F70) true
charpath

clip newpath


/TimesNewRomanPS-BoldMT 96 selectfont 50 500 moveto (F70) true
charpath


If you want less code, you can do this:

{/TimesNewRomanPS-BoldMT 96 selectfont 50 500 moveto (F70) true
charpath}dup exec
clip newpath exec


-David


jdaw1

unread,
Jan 8, 2009, 8:32:56 AM1/8/09
to
> Interesting bug.
I've just discovered that the bug doesn't happen if the string is only
a single character. No bug with (G); yes bug with (GB). Odder and
odder.

> Changing the line 'clip' to 'clip newpath clippath' will fix the
> clipping problem but then you may find the interior paths inside the
> glyph outline are not the same (though you may like the patterns).

Odder still. And yuck!

> dup exec clip newpath exec

Nice solution -- thank you.

jdaw1

unread,
May 7, 2017, 6:53:44 AM5/7/17
to
And 8⅓ years later, this bug just bit me again. It has not been fixed as of Distiller XI Pro 11.0.20 (28/03/2017).

jdaw1

unread,
May 7, 2017, 6:32:55 PM5/7/17
to

jdaw1

unread,
Jan 17, 2018, 6:10:02 PM1/17/18
to
On 12 Jan 2018, in the above thread, Adobe replied:
> Thanks for bringing this issue to our notice. we have logged bug in our database for the same and will be prioritized based on other work items.
0 new messages