Skip to main content
Participant
May 20, 2022
Question

Postscript fonts

  • May 20, 2022
  • 2 replies
  • 651 views

I am attempting to include a degree symbol data displayed using a courier font.  Is there a way to this to be implemented?

Currently degree displays as shown below.

 

    This topic has been closed for replies.

    2 replies

    Legend
    June 2, 2022

    You can't use Unicode code points. Use the Encoding for the font, or re-encode it. This is old school PostScript, from years before Unicode was invented. There is no Unicode in PostScript, it's been frozen 20 years now.

    Participant
    June 3, 2022

    How does one Encode or re-encode a font (say Courier) to include a degree symbol?

    Brad @ Roaring Mouse
    Community Expert
    Community Expert
    June 6, 2022

    In the Windows world, for example, to type a degree symbol you had to use an ALT code, which is where you would hold down the Alt key and type a number ON THE NUMBER PAD (i.e. not the keys at the top of your keyboard) then release. The Alt-code for a degree symbol was 0176, so you would hold down Alt, type 0176 then release.

    If you did this in a sample file, and export that to Postscript, you could find the code used to actually invoke the degree symbol from your font. e.g. in a Windows PS file, "Sample°" would appears as "Sample\260" (the \260 is the degree symbol). But this varies between systems, fonts and font formats, so you would need some testing.

    Brad @ Roaring Mouse
    Community Expert
    Community Expert
    May 23, 2022

    How are you creating this text?

    The degree symbol can fall in various different charcter locations depending on the font, format and its encoding.

    With Unicode it's easier: you are looking for U +00B0

    Participant
    May 23, 2022

    The degree symbol is copied into an alpha variable.  Maye created in word or updated from a source which contains the degree symbol.

    I am defining the Courier font shown

    /cour { /Courier findfont 10 scalefont setfont } def

    Courier is used because it is a fixed width font.

    How is U +00B0 font implemented in postscript?

    Is it a fixed witdh font?