Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

PostScript Font and Text Effects

Guest
Jun 04, 2012 Jun 04, 2012

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?

TOPICS
Programming
5.3K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Jun 04, 2012 Jun 04, 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jun 05, 2012 Jun 05, 2012

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Jun 05, 2012 Jun 05, 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 22, 2020 Jan 22, 2020
LATEST

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines