ref: 3ef2fcee4e2fe8e296b1b823b636b70f4bd76336
parent: 6477491bab369fc4218eee234f2e9b7aaa3677ef
author: Ali Gholami Rudi <ali@rudi.ir>
date: Sun Aug 4 09:07:38 EDT 2013
ps: modify fontlookup to match selectfont's signature
--- a/ps.c
+++ b/ps.c
@@ -53,10 +53,10 @@
"/rgb {255 div 3 1 roll 255 div 3 1 roll 255 div 3 1 roll setrgbcolor} bind def\n"
"/done {/lastpage where {pop lastpage} if} def\n"
"\n"
- "% caching fonts returned from findfont in fncache\n"
+ "% caching fonts, as selectfont is supposed to be doing\n"
"/fncache 7 array def\n"
"/fncidx 0 def\n"
- "/fontlookup {\n"
+ "/selectfont_cached {\n"
" /fsize exch def\n"
" /fname exch def\n"
" /font null def\n"
@@ -76,13 +76,12 @@
" /fncidx 0 def\n"
" } if\n"
" } if\n"
- " font fsize scalefont\n"
+ " font fsize scalefont setfont\n"
"} bind def\n"
"/f {\n"
" /font exch def /ptsize exch def\n"
" ptsize scaling div /size exch def\n"
- " % to disable caching: font findfont size scalefont setfont\n"
- " font size fontlookup setfont\n"
+ " font size selectfont_cached\n"
" linewidth ptsize mul scaling 10 mul div setlinewidth\n"
"} bind def\n"
"\n"