🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: adobe.postscript.programming
4 messages
4 total messages Started by David_M_Reed Wed, 07 Apr 2004 17:11
Printing a "registered" trademark
#571
Author: David_M_Reed
Date: Wed, 07 Apr 2004 17:11
4 lines
948 bytes
I know that under ISOLatin1 the "registered" trademark symbol can be printed with an octal code of \256 (according to the language manual
appendex E). However, I am unclear in how to change the encoding. The
example 5.6 in the manual does not give enough info. HELP!!
Any snippet of code would be greatly appreciated.
Re: Printing a "registered" trademark
#572
Author: tgreer
Date: Wed, 07 Apr 2004 17:34
41 lines
1667 bytes
Step one: create a copy of the original font dictionary. This is because font dictionaries are read-only.

A clever way to do this:

<< originalFont findfont {} forall >>

Which will leave you with a font dictionary on the stack.

(You'll want to precede that with a name for your new font, ie /ISOfont)

Make this your current dictionary with "begin".

Change the /Encoding entry:

/Encoding ISOLatin1Encoding 256 array copy def

Pop the dictionary of the operand stack: end

Make this dictionary a font: definefont pop

Note: you might want to reinsert some of the original encodings. I put in the bullet, hyphen, and trademark encodings.

Complete code:

/ISOfont
<< /Courier findfont {} forall >>
   begin
     /Encoding ISOLatin1Encoding 256 array copy def
     currentdict
     Encoding 8#267 /bullet put
     Encoding 8#055 /hyphen put
     Encoding 8#231 /trademark put
   end
definefont pop

Usage:

/ISOfont 24 selectfont

Thomas D. Greer
www.tgreer.com
Re: Printing a "registered" trademark
#573
Author: David_M_Reed
Date: Wed, 07 Apr 2004 18:56
6 lines
1024 bytes
Thanks!! This worked. But I have one other question. Why do I need
to put the 2 variables that the program calls for in a total of 6
times? The first variable (name) I have to put on the stack 3 times
and the second variable (case number) I put on the stack 3 times.
Otherwise I get stackunderflow errors at definefont or selectfont.
Just curious....
Re: Printing a "registered" trademark
#574
Author: tgreer
Date: Wed, 07 Apr 2004 19:59
8 lines
1125 bytes
I don't know what variables you're talking about. PostScript doesn't use "variables" per se.

Send me your "working code", and I'll see what's going on.

Either post it here or email me, your preference. You can get my email address from my website.

Thomas D. Greer
www.tgreer.com
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