[PD] pd pretty print

Peter P. peterparker at fastmail.com
Tue Sep 26 13:27:17 CEST 2017

* Peter P. <peterparker at fastmail.com> [2017-09-26 13:25]:
> Hi list,
> this topic is somewhat known. How do I print postscript (vector graphic)
> from Pd's "Print..." menu entry?
> For now pd creates postscript files, which can be converted to pdf using 
> 	ps2pdf
> optioanlly followed by
> 	pdfcrop
> (at least on Linux). Nevertheless the font type, size and positions are
> different (and ugly) compared to the initial patch. Miller kindly shared
> his awk script on this list, to change fontsizes in the .ps files. Andy
> Farnell seems to have worked on this as well. If I am not mistaken it
> does something like
> 	awk 'BEGIN  {last = -10}
>         /findfont 8/  {
>             last=NR
>             $1 = "/Courier-Bold"
>             $3 = 11.3
>         }
>         {
>             print
>         }' $1 > /tmp/tmp2.ps
> I am wondering about the following: Depending on the patch fontsize, the
> "/findfont 8/" might hold a different value. I am wondering how these
> values correspond to pd font sizes, as this seems to have changed a bit
> over the last years. 
> Printing the testtone.pd patch with a Pd fontsize of 12 yields
> testtone.ps which holds entries of the form.
> 	/DejaVuSansMono-Bold findfont 7
> Changing them with a modified version of above awk script to 
> 	/Courier-Bold findfont 12
> and running ps2pdf and pdfcrop on it will give fonts too small compared
> to the tcltk GUI yet at slightly elevated vertical position (see the
> attached file testtone-crop.pdf).
> I am wondering what, as of 2017, is the best practice to pretty print pd
> patches in vector graphic format and hope to additionally find out why it
> is so hard to do.
Oh, and if or how some of the awk/ps2pdf functionality could be put into
Pd eventually.

More information about the Pd-list mailing list