Graphics Programs Reference
In-Depth Information
by using a dictionary instead of a name for the encoding. The entries in this dictionary
are summarized in
Table 6-5
.
Table 6-5. Entries in an encoding dictionary
Key
Value type
Value
/Type
name
Must be
/Encoding
/BaseEncoding
name
The
base encoding
, from which the
/Differences
entry defines differences. This is
one of the predefined encodings
/MacRomanEncoding
,
/MacExpertEncoding
,
or
/WinAnsiEncoding
. If this entry is absent, the differences are from the font file's
built-in encoding.
/Differences
array of
integers and
names
Defines the differences from the base encoding. Contains zero or more sections each
beginning with a number
n
followed by glyph names for character n, n+1, n+2 etc. For
example
[6 /endash /emdash 34 /space]
maps
6
to
/endash
,
7
to
/emdash
, and
34
to
/space
.
In
Example 6-1
, the font has an encoding that defines a difference from the built-in font
encoding by replacing character 1 by the character
/bullet
(the bullet point). This
means that the PDF viewer can cut and paste the text properly, because it now knows
that character code 1 is a bullet point (names like
/bullet
are predefined in the
Adobe
Glyph List
). It makes no difference to the display of the PDF.
Example 6-1. A font encoding for a font with the bullet point added
25 0 obj
<< /Type /Font
/Subtype /Type1
/Encoding 23 0 R
Reference to the encoding dictionary.
/BaseFont /Symbol
/ToUnicode 24 0 R
Instructions for conversion to Unicode.
>>
endobj
23 0 obj
Encoding dictionary
<< /Type /Encoding
/BaseEncoding /WinAnsiEncoding
The base encoding.
/Differences [ 1 /bullet ]
The differences
>>
endobj
Embedding a Font
When creating a PDF file, the fonts must be
embedded
, so that the glyph descriptions
and encodings are available to the program showing the PDF or processing it in other
ways. To embed a font: