Article View: comp.lang.postscript
Article #469Re: Underline font
From: Rich Berlin
Date: Sat, 11 Apr 1992 02:40
Date: Sat, 11 Apr 1992 02:40
31 lines
1295 bytes
1295 bytes
---
% show a string, underlined. Not very fancy, but gets the job done.
/show-underlined { % string => -
gsave
% UnderlinePosition and UnderlineThickness are represented
% relative to the native font coordinate system, so we need to
% roll them through FontMatrix
currentfont begin
FontInfo begin
UnderlineThickness UnderlinePosition FontMatrix dtransform
end
end
% (relative) move to UnderlinePosition
0 exch rmoveto
% set line width to UnderlineThickness
setlinewidth
% find the width of the string and draw a line just that wide
dup stringwidth rlineto
% stroke it, using square end caps
0 setlinecap stroke
grestore
% now (finally) show the string.
show
} bind def
Technical Details
Message-ID:
<kuckd9INNsdh@exodus.Eng.Sun.COM>Path:
arc1-ca.pugleaf.net!sparky!uunet!sun-barr!news2me.ebay.sun.com!exodus.Eng.Sun.COM!birdland!rberlinReferences:
<3245@vidiot.UUCP>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!sun-barr!news2me.ebay.sun.com!exodus.Eng.Sun.COM!birdland!rberlin From: rberlin@Eng.Sun.COM (Rich Berlin) Newsgroups: comp.lang.postscript Subject: Re: Underline font Message-ID: <kuckd9INNsdh@exodus.Eng.Sun.COM> Date: 11 Apr 92 02:40:41 GMT References: <3245@vidiot.UUCP> Reply-To: rberlin@Eng.Sun.COM Organization: SunPics -- A Sun Microsystems Business Lines: 31 NNTP-Posting-Host: birdland