🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.postscript
Article #9173

Re: Superscript etc in Postscript

#9173
From: Ross A. Jeynes
Date: Mon, 05 Mar 1990 22:11
41 lines
1798 bytes
In article <2879@ursa.UUCP> raj@ursa.UUCP () writes:
>When you print a string using the show command (or equivalent)
>is there a way of embedding escape sequences in the string
>to obtain subscript, superscript, bold, italic etc. effects?
>

Here's a very general procedure to do super/subscript. 

The way it works: pass SS the string to be shown, the distance above or
below the baseline to show the string, and a multiplier of the current
pointsize to show the string in (1/2 usually looks pretty good). 

Any other good ideas out there?

--------Cut Here---------
/bdef {bind def} bind def

/SS {  % (str) DeltaY PtSizeMult SS --      superscript / subscript 
  gsave
    currentfont exch scalefont setfont    % (str) DeltaY
    0 exch rmoveto                        % (str)
    show                                  % --
    currentpoint pop                      % x
  grestore
  currentpoint exch pop                   % x y
  moveto
} bdef


/Times-Roman findfont 20 scalefont setfont

100 100 moveto
(This is normal text) show
( and this is superscript) 7 .5 SS

showpage
--------Cut Here---------

Ross "let's program, dudes" Jeynes              
Developer Support                                   jeynes@adobe.com
Adobe Systems Incorporated                 {sun|decwrl}!adobe!jeynes
Technical Details
Message-ID: <1927@adobe.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uwm.edu!lll-winken!decwrl!adobe!jeynes
References: <2879@ursa.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uwm.edu!lll-winken!decwrl!adobe!jeynes
From: jeynes@adobe.COM (Ross A. Jeynes)
Newsgroups: comp.lang.postscript
Subject: Re: Superscript etc in Postscript
Keywords: Bold, superscript, italic etc.
Message-ID: <1927@adobe.UUCP>
Date: 5 Mar 90 22:11:19 GMT
References: <2879@ursa.UUCP>
Reply-To: jeynes@adobe.UUCP (Ross A. Jeynes)
Organization: Adobe Systems Incorporated, Mountain View
Lines: 41