Article View: adobe.postscript.programming
Article #1228Re: Composite Fonts
From: Seth Gorden
Date: Mon, 17 Feb 2003 23:01
Date: Mon, 17 Feb 2003 23:01
48 lines
2095 bytes
2095 bytes
I was using a standard example of composite font definition as follows...
/LetterFont
<<
/FontType 0
/FontMatrix [1 0 0 1 0 0]
/FDepVector
[
>/Times-Roman findfont
>/Times-Bold findfont
>/Times-Italic findfont
>/Times-BoldItalic findfont
]
/Encoding [0 1 2 3]
/FMapType 3
>> definefont pop
As it turns out, a couple hours of researching the font encoding and definitions,
I finally landed upon the ever-so-subtle discovery that after an escape/offset
sequence like "/337/001", postscript printers don't like spaces. If there
is not a visible character after this escape/offset, postscript will attempt
to interpret them as characters, which led it to the ISO vector, which
output '�' instead of escaping to the composite font.
So programmers beware, keep your composite font escapes followed tightly by actual text. White space is bad.
Example:
/LetterFont 11 selectfont
(Your mom\377\001 likes\377\000 spam.) show
Error:rangecheck
Offending command: stringwidth
Stack:
mom�
wordwidth
....(and so on)
=====================================
THE CORRECT WAY
/LetterFont 11 selectfont
(Your mom \377\001likes \377\000spam.) show
Your mom likes spam.
Technical Details
Message-ID:
<1de7e40c.2@WebX.la2eafNXanI>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!newshosting.com!news-xfer1.atl.newshosting.com!btnet-peer0!btnet-peer!btnet!lnewspeer01.lnd.ops.eu.uu.net!emea.uu.net!newsfeed01.sul.t-online.de!t-online.de!WebXReferences:
<1de7e40c.-1@WebX.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: 10c61a,43ebda4188b25dc6 X-Google-Attributes: gid10c61a,public X-Google-ArrivalTime: 2003-02-17 15:08:05 PST From: "Seth Gorden" <smig002@yahoo.com> Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!newshosting.com!news-xfer1.atl.newshosting.com!btnet-peer0!btnet-peer!btnet!lnewspeer01.lnd.ops.eu.uu.net!emea.uu.net!newsfeed01.sul.t-online.de!t-online.de!WebX Newsgroups: adobe.postscript.programming Subject: Re: Composite Fonts Message-ID: <1de7e40c.2@WebX.la2eafNXanI> Date: Mon, 17 Feb 2003 15:01:07 -0800 References: <1de7e40c.-1@WebX.la2eafNXanI> Lines: 47 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit