PostScript Font and Text Effects

Copy link to clipboard
Copied
Here is my situation.
I want to be able to represent the Fonts and their styles of Microsoft Word in a PostScript Program.
For example, how can I code a font (for example "Times New Roman") with Bold, Italic and Underlined in postscript? Well, I wish to be able to do this without defining my own font in postscript. That would be a lot of work.
My question is, in such a case, is there any postscript command that will help me accomplish the same?
Copy link to clipboard
Copied
You can select Helvetica font size 12 points e.g.
/Helvetica 12 selectfont
or a 10 point Times-BoldItalic (or use Bold or Italic) e.g.
/Times-BoldItalic 10 selectfont
The font can be embedded for example as a Type 1 font. Some common or base fonts will be installed on your printer
or other interpreter so they do not need to be embedded.

Copy link to clipboard
Copied
But, how can I accomplish such styles as underline, Strike-through, Subscript etc...?
Copy link to clipboard
Copied
Below is a simple underline example but fonts can provide the following optional information
which you could check for:
/UnderlineThickness
/UnderlinePosition
/ulshow % string on stack
{
currentpoint /y exch def /x exch def
dup
show
stringwidth pop dup neg 0 rlineto stroke
x add y moveto
} def
72 720 moveto
/Courier 18 selectfont
(Hello ) show (World ) ulshow (GoodNight ) show (Moon.) ulshow
showpage
Copy link to clipboard
Copied
Hi,
I see your example to underlining text but I would like to Strike Through text (line in the middle of the text)
I tried to modify your underline example but I am struggling.
Can tyou help please?
Thanks
Rob

