Skip to main content
June 4, 2012
Question

PostScript Font and Text Effects

  • June 4, 2012
  • 1 reply
  • 5366 views

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?

This topic has been closed for replies.

1 reply

Participating Frequently
June 4, 2012

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.

June 5, 2012

But, how can I accomplish such styles as underline, Strike-through, Subscript etc...?

Participating Frequently
June 5, 2012

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