Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Underline text? 1

Status
Not open for further replies.

Hemo

Programmer
Apr 9, 2003
190
US

Is there an easy way to have my text output underlined? A font or parameter to pass to a font?

I've been doing it code and it just seems there should be an easier way...

 
Ahhhhhharrggggg!

Adobe must've been staffed by masochists when postscript was developed...

Guess I'll keep doing it the way I am then.
 
Hemo,
If possible can you post an example code to underline the output text.
 
This is what I've been using, and it has worked for me so far:

Code:
% a routine to underline the text you are printing
/ushow % linethick lineposition (string) ushow -
{ % underlines text
        % call this (ushow) instead of show when placing text
        % and the text will be underlined.
        % pass line thickness and offset with string
        % ie 0.1 -0.8 (Text) ushow
        % draws a line 0.1 thick and 0.8 below (-0.8) text position
        % ie. 10 10 moveto 0.1 -0.8 (Text) ushow
        gsave
        exch 0 exch rmoveto
        dup stringwidth rlineto
        exch setlinewidth stroke
        grestore
        show
} bind def

ymmv
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top