Article View: comp.lang.postscript
Article #470Re: Underline font
From: Larry Phillips
Date: Sat, 11 Apr 1992 06:36
Date: Sat, 11 Apr 1992 06:36
50 lines
1770 bytes
1770 bytes
Rich Berlin supplies a 'show-underlined' routine. The fellow who
wanted it said he would like to have an underline that does not
go through the descenders. I have modified Rich's routine, though
some improvement could probably be made to the modification.
---
% 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
% Clear part of the line where the descenders will be
gsave
dup
1.5 setlinewidth 1 setgray
true charpath stroke
grestore
% now (finally) show the string.
show
} bind def
/Courier findfont 20 scalefont setfont
50 100 moveto
(Large Eggs with pepper and juicy quince pie) show-underlined
showpage
---
-larry
Technical Details
Message-ID:
<11376@mindlink.bc.ca>Path:
arc1-ca.pugleaf.net!sparky!uunet!think.com!ames!agate!rsoft!mindlink!a10Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!think.com!ames!agate!rsoft!mindlink!a10 From: Larry_Phillips@mindlink.bc.ca (Larry Phillips) Newsgroups: comp.lang.postscript Subject: Re: Underline font Message-ID: <11376@mindlink.bc.ca> Date: 11 Apr 92 06:36:27 GMT Organization: MIND LINK! - British Columbia, Canada Distribution: world Lines: 50