Thread View: adobe.postscript.programming
3 messages
3 total messages
Started by David Frier
Fri, 25 Jul 2003 13:49
Newbie Question: Text Expressions?
Author: David Frier
Date: Fri, 25 Jul 2003 13:49
Date: Fri, 25 Jul 2003 13:49
14 lines
1679 bytes
1679 bytes
I am hoping the members of this group can help out with a postscript newbie question. I have a need (for reasons too hilarious to go into here) to post-process Postscript output files from an application before they go to print. What I need to do is find a certain byte value (0xBA) and change it to print as a Registered Trademark symbol. I think the best way to do this is to insert an escape sequence into the operand for the ( ) show command such that the magic byte becomes a 'registered.' I am having the devil's own time finding the right reference to how this would be constructed. As a follow-up question, since I obviously need it, where o where is a decent online PS tutorial??? So, to clarify. What I am looking for is how to insert a character from the font BY NAME into an otherwise literal string, because the desired character happens not to be in the symbolset selected. TIA!! -- --David Frier <http://www.dfconsultants.com/>
Re: Newbie Question: Text Expressions?
Author: 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.
Re: Newbie Question: Text Expressions?
Author: Gunnar Fing Blodgett
Date: Mon, 28 Jul 2003 19:19
Date: Mon, 28 Jul 2003 19:19
9 lines
859 bytes
859 bytes
David Whoops. fontName-Aux 12 selectfont is wrong; use /fontName-Aux 12 selectfont Gunnar
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads