PostScript distiller ignores clip after charpath
Sometimes, clip after charpath is ineffective in Adobe Distiller 20.0, 20.005.30635. PostScript files cannot be attached, so code follows. Obviously, if Adobe’s software does embarrassing line wrapping, unwrap.
%!PS
<< /PageSize [560 365] >> setpagedevice
% DeFontPath has two uses.
% Bug in Adobe Distiller 8.1.3 (23/10/2006). In attempting to treat paths derived from text as copyable text, it fails to cope with paths made partly thereby and partly from a upath.
% Bug in Adobe Distiller 20.0, 20.005.30635, PostScript software version 3018.101, in which sometimes, a clip of a text-derived charpath had no effect.
% https://acrobat.uservoice.com/forums/590923-acrobat-for-windows-and-mac/suggestions/19193479-distiller-charpath-clip-stroke-does-not-honou
% https://groups.google.com/g/comp.lang.postscript/c/ewwOV_qN4JQ
/DeFontPath
{
[ {/moveto cvx} {/lineto cvx} {/curveto cvx} {/closepath cvx} pathforall ] newpath cvx exec
% Fuller version available from https://github.com/jdaw1/placemat/blob/main/PostScript/placemat.ps
} bind def % /DeFontPath
/GothamNarrow-Bold 480 selectfont
1 setlinejoin 1 setlinecap [] 0 setdash
% Page 1: clip ignored. Black overwrites red. And black shown extra-wide.
12 12 moveto
(78) true charpath
gsave 1 0 0 setrgbcolor 4 setlinewidth stroke grestore
0 setgray 8 setlinewidth clipsave clip stroke cliprestore
showpage
% Page 2: clip heeded (hurray!). Black not present outside, so red visible.
12 12 moveto
(78) true charpath DeFontPath % Path converted from text to non-text path.
gsave 1 0 0 setrgbcolor 2 setlinewidth stroke grestore
0 setgray 4 setlinewidth clipsave clip stroke cliprestore
showpage
count =