Path: utzoo!utgpu!water!watmath!clyde!att!ucbvax!husc6!linus!mbunix!ted From: ted@mitre-bedford.ARPA (Edward J. Ede) Newsgroups: comp.lang.postscript Subject: Re: Postscript Underlining Keywords: Postscript, Underline Message-ID: <39161@linus.UUCP> Date: 22 Aug 88 14:43:03 GMT References: <259@tahoma.UUCP> Sender: news@linus.UUCP Reply-To: ted@mbunix (Ede) Organization: The MITRE Corporation, Bedford, Mass. Lines: 26 In article <259@tahoma.UUCP> wam6186@tahoma.UUCP (Warren A. Murray) writes: >Is there anyone out there who knows how to do underlining in >Postscript? I need an algorithm that will work with any of >the Apple LaserWriter Plus fonts at any size. > >Mike Haldeman Voice: (206) 237-2577 In all of Adobe's font dictionaries, there exists another dictionary named FontInfo. Within FontInfo there are two numbers: UnderlinePosition and UnderlineThickness. They are both in the Character Coordinate System (to use them, divide by 1000 and multiply by the current point size). For example, the numbers for Courier are -82 and 40, so in 12 point, move -.98 points (-82/1000*12) from the baseline and stroke a line .48 points (40/1000*12) thick. You can use the stringwidth operator to get the proper length. For a more detailed explanation, look in section 5.3 of the red bood, "Font Dictionaries". I'd write a procedure for you, but my PostScript, as of late, is a bit rusty :-( In a bind, just use italics :-) Ted Ede -- ted@mitre-bedford.arpa -- The MITRE Corporation -- Burlington Road | linus!mbunix!ted -- Bedford MA, 01730 -- Mail Stop B015 -- (617) 271-2524 | | - this line intentionally left blank - | +---------------------------------------------------------------------------+