Article View: adobe.postscript.programming
Article #904Re: Newbie Question: Text Expressions?
From: Gunnar Fing Blodgett
Date: Mon, 28 Jul 2003 18:37
Date: Mon, 28 Jul 2003 18:37
35 lines
2486 bytes
2486 bytes
David
You'll have a time of it indeed.
To begin with, registered (���)and trademark (�) are two distinct symbols. Secondly, neither one of them is in the 128-character basic ASCII set (see <http://czyborra.com/charsets/iso8859.html#ISO-8859-1> at Alphabet Soup). Finally, there are several different standards for directing fonts (StandardEncoding and ISOLatin1Encoding are two) to include non-basic ASCII characters on output.
ISOLatin1Encoding includes registered (���) and copyright (�) but not trademark (�), or bullet (�) for that matter. If your fonts are organized by the ISOLatinEncoding vector, then you can get the registered mark as you suggest using the (\0256) octal escape value (decimal 174, but PostScript strings take octal).
If your fonts are not organized by the ISOLatin1Encoding vector (a good bet), then you have the fun of re-encoding them. We do this:
/Rf {
3 2 roll findfont dup length
dict begin {
1 index /FID ne
{def} {pop pop} ifelse
} forall
/Encoding exch def
/FontName exch def
FontName currentdict end
definefont pop
} def
/newEncoding ISOLatin1Encoding aload pop 256 array astore def
% for characters not included in ISOLatin1 encoding
newEncoding 8#231 /trademark put
/fontName /fontName-Aux newEncoding Rf
fontName-Aux 12 selectfont
72 72 moveto (\231 \256) show
Learning PostScript is not for the faint of heart; it's like Spanish in that the basic vocabulary can be picked up easily, but the language takes years to master. Here is a good starting point:
<http://www.geocities.com/SiliconValley/5682/Programming.html>
Good luck.
Technical Details
Message-ID:
<1dea10dd.0@WebX.la2eafNXanI>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-01!sn-xit-09!supernews.com!newshosting.com!news-xfer2.atl.newshosting.com!diablo.voicenet.com!in.100proofnews.com!in.100proofnews.com!nntp.infostrada.it!newsfeed01.sul.t-online.de!t-online.de!WebXReferences:
<1dea10dd.-1@WebX.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: 10c61a,8dd029680a274b0b X-Google-Attributes: gid10c61a,public X-Google-ArrivalTime: 2003-07-28 12:08:06 PST From: "Gunnar Fing Blodgett" <gunnar.blodgett@net-linx.com> Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-01!sn-xit-09!supernews.com!newshosting.com!news-xfer2.atl.newshosting.com!diablo.voicenet.com!in.100proofnews.com!in.100proofnews.com!nntp.infostrada.it!newsfeed01.sul.t-online.de!t-online.de!WebX Newsgroups: adobe.postscript.programming Subject: Re: Newbie Question: Text Expressions? Message-ID: <1dea10dd.0@WebX.la2eafNXanI> Date: Mon, 28 Jul 2003 11:37:33 -0700 References: <1dea10dd.-1@WebX.la2eafNXanI> Lines: 47 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit