Skip to main content
Participating Frequently
August 17, 2009
Answered

Synthesized bolding in PostScript

  • August 17, 2009
  • 2 replies
  • 984 views

When generating a PDF file I preceed text with something like:  "0.46 w 2 Tr" in order to make text in a normal font look bold.


It works just fine in a PDF file but I would like to be able to do the same thing in a PostScript file. Is there any operator or construct of any sort in PostScript that will accomplish this?


Thanks,

    Allan.

This topic is closed to new replies. Start a new post to keep the conversation going.
Correct answer Helge Blischke

There is no such simple means to achieve this effect in PostScript. You need to do it using a PostScript procedure

like this:

/emulate_bold

{

   gsave

   1 index show   % paint the string by filling

   currentpoint     % save position at the end of the string

   4 2 roll

   grestore

   gsave

   setlinewidth

   false charpath stroke

   grestore

   moveto  % move to the end of the string

}bind def

It is to be used like follows

(Symthesized )show (bolding) 0.46 emulate_bold ( in PostScript)show

to achieve

Synthesized bolding in PostScript

2 replies

Helge BlischkeCorrect answer
Participating Frequently
August 19, 2009

There is no such simple means to achieve this effect in PostScript. You need to do it using a PostScript procedure

like this:

/emulate_bold

{

   gsave

   1 index show   % paint the string by filling

   currentpoint     % save position at the end of the string

   4 2 roll

   grestore

   gsave

   setlinewidth

   false charpath stroke

   grestore

   moveto  % move to the end of the string

}bind def

It is to be used like follows

(Symthesized )show (bolding) 0.46 emulate_bold ( in PostScript)show

to achieve

Synthesized bolding in PostScript

Participating Frequently
August 19, 2009

Thanks Helge.

This works great!

Allan.