Path: 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 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