Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!news.glorb.com!news-out.readnews.com!transit3.readnews.com!panix!not-for-mail From: dkcombs@panix.com (David Combs) Newsgroups: comp.lang.postscript Subject: Re: Is it possible to replace 1 custom character in a font?? Date: Mon, 13 Aug 2012 13:15:16 +0000 (UTC) Organization: Public Access Networks Corp. Lines: 45 Message-ID: References: <988c7d8d-49db-4d82-b878-a0466503a0c6@googlegroups.com> NNTP-Posting-Host: panix1.panix.com X-Trace: reader1.panix.com 1344863716 22217 166.84.1.1 (13 Aug 2012 13:15:16 GMT) X-Complaints-To: abuse@panix.com NNTP-Posting-Date: Mon, 13 Aug 2012 13:15:16 +0000 (UTC) X-Newsreader: trn 4.0-test76 (Apr 2, 2001) Xref: csiph.com comp.lang.postscript:879 >I cooked-up an example. > >%! >%customchar.ps >%Example replaces the space char (using ASCII decimal code) >%with a big black 'em'-square > >/q{0 0 moveto 1 0 lineto 1 1 lineto 0 1 lineto closepath}def > >/X< /Encoding StandardEncoding > /BuildChar{ % font char(int) > exch pop > dup 32 eq { pop > 1 0 0 0 1 1 setcachedevice > q fill > }{ > /Times-Roman 1 selectfont > (?) dup 0 4 3 roll put dup stringwidth %(?) Wx Wy > 0 0 1 1 setcachedevice > 0 0 moveto > show > }ifelse > } >>>definefont pop > >/X 30 selectfont > >100 300 moveto >(Modified Font?) show > Thanks for saving people some programming. I will save this post for possible future use. But first a probably insulting question: you did TEST the code? (I ask only because so many cs textbooks include program after program (source) that won't even compile, perhaps even in the human brain!) David