Skip to main content
Participating Frequently
Aug 17, 2009 5:01 PM UTC
Answered

Synthesized bolding in PostScript

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.
Helge BlischkeCorrect answer
Participating Frequently
Aug 19, 2009 9:07 PM UTC

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
Aug 19, 2009 9:07 PM UTC

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

Translate
Participating Frequently
Aug 19, 2009 9:39 PM UTC

Thanks Helge.

This works great!

Allan.

Translate