mf2pt1: Custom font encodings

 
 2.4 Custom font encodings
 =========================
 
 SeeParameters, lists the font encodings currently supported by
 'mf2pt1' and mentions that an alternate encoding can be specified by
 providing the name of an encoding file.  To elaborate, the following
 example represents the contents of an encoding file which defines
 a--largely useless nowadays--EBCDIC font encoding:
 
      '% Sample encoding vector: EBCDIC
 
      % The encoding vector must have a name and be defined as a
      PostScript array.
      /ebcdic_encoding [
      /_a0 /_a1 /_a2 /_a3 /_a4 /_a5 /_a6 /_a7 /_a8 /_a9 /_a10 /_a11 /_a12
      /_a13 /_a14 /_a15 /_a16 /_a17 /_a18 /_a19 /_a20 /_a21 /_a22 /_a23
      /_a24 /_a25 /_a26 /_a27 /_a28 /_a29 /_a30 /_a31 /_a32 /_a33 /_a34
      /_a35 /_a36 /_a37 /_a38 /_a39 /_a40 /_a41 /_a42 /_a43 /_a44 /_a45
      /_a46 /_a47 /_a48 /_a49 /_a50 /_a51 /_a52 /_a53 /_a54 /_a55 /_a56
      /_a57 /_a58 /_a59 /_a60 /_a61 /_a62 /_a63 /space /_a65 /_a66 /_a67
      /_a68 /_a69 /_a70 /_a71 /_a72 /_a73 /bracketleft /period /less
      /parenleft /plus /exclam /ampersand /_a81 /_a82 /_a83 /_a84 /_a85
      /_a86 /_a87 /_a88 /_a89 /bracketright /dollar /asterisk /parenright
      /semicolon /asciicircum /hyphen /slash /_a98 /_a99 /_a100 /_a101
      /_a102 /_a103 /_a104 /_a105 /bar /comma /percent /underscore
      /greater /question /_a112 /_a113 /_a114 /_a115 /_a116 /_a117 /_a118
      /_a119 /_a120 /_a121 /colon /numbersign /at /quoteright /equal
      /quotedbl /_a128 /a /b /c /d /e /f /g /h /i /_a138 /_a139 /_a140
      /_a141 /_a142 /_a143 /_a144 /j /k /l /m /n /o /p /q /r /_a154
      /_a155 /_a156 /_a157 /_a158 /_a159 /_a160 /asciitilde /s /t /u /v
      /w /x /y /z /_a170 /_a171 /_a172 /_a173 /_a174 /_a175 /_a176 /_a177
      /_a178 /_a179 /_a180 /_a181 /_a182 /_a183 /_a184 /quoteleft /_a186
      /_a187 /_a188 /_a189 /_a190 /_a191 /braceleft /A /B /C /D /E /F /G
      /H /I /_a202 /_a203 /_a204 /_a205 /_a206 /_a207 /braceright /J /K
      /L /M /N /O /P /Q /R /_a218 /_a219 /_a220 /_a221 /_a222 /_a223
      /backslash /_a225 /S /T /U /V /W /X /Y /Z /_a234 /_a235 /_a236
      /_a237 /_a238 /_a239 /zero /one /two /three /four /five /six /seven
      /eight /nine /_a250 /_a251 /_a252 /_a253 /_a254 /_a255
      % Don't forget to end the array.
      ] def'
 
    All entries in the encoding vector are PostScript "names" and
 therefore must be prefixed with a slash.  Unnamed characters such as
 control characters are commonly named '_aNUMBER', where NUMBER is the
 decimal offset into the character table.  Undefined characters are
 indicated by '.notdef'.  In the EBCDIC example, the character at position 0
 in the font will be named 'a0'; the character at position 1 will be
 named 'a1'; the character at position 74 will be named 'bracketleft';
 the character at position 129 will be named 'a'; and so forth.
 
    Individual characters can be mapped to an encoding either numerically
 or by executing a *glyph_name* command within a character definition.
 For example, the following code overrides the character position passed
 to *beginchar* (i.e., 123) with whatever character position the current
 encoding has designated for the 'ohungarumlaut' glyph:
 
      beginchar (123, cap_height#-1/2pt#, cap_height#, 0);
        if known ps_output:
          glyph_name "ohungarumlaut";
        fi
        ...
      endchar;