Repository navigation
PDF20 Spec 09 Font Descriptors
Part of: PDF20-Spec-09-Text
Navigation: PDF20-Spec-09-Composite-Fonts | PDF20-Spec-Index | PDF20-Spec-09-Embedded-Fonts
9.8
Font descriptors
9.8.1 General A font descriptor specifies metrics and other attributes of a simple font or a CIDFont as a whole, as distinct from the metrics of individual glyphs. These font metrics provide information that enables a PDF processor to synthesise a substitute font or select a similar font when the font program is unavailable. The font descriptor may also be used to embed the font program in the PDF file. Font descriptors shall not be used with Type 0 fonts. Beginning with PDF 1.5, font descriptors may be used with Type 3 fonts. A font descriptor is a dictionary whose entries specify various font attributes. The entries common to all font descriptors — for both simple fonts and CIDFonts — are listed in "Table 120 — Entries common to all font descriptors". Additional entries in the font descriptor for a CIDFont are described in 9.8.3, "Font descriptors for CIDFonts". All dimensional values shall be units in glyph space. The conversion from glyph space to text space is described in 9.2.4, "Glyph positioning and metrics". Table 120 — Entries common to all font descriptors Key
Type
Value
Type
name
(Required) The type of PDF object that this dictionary describes; shall be FontDescriptor for a font descriptor.
FontName
name
(Required) The PostScript name of the font. This name shall be the same as the value of BaseFont in the font or CIDFont dictionary that refers to this font descriptor.
FontFamily
byte string
(Optional; PDF 1.5) A byte string specifying the preferred font family name. EXAMPLE 1
FontStretch
name
(Optional; PDF 1.5) The font stretch value. It shall be one of these names (ordered from narrowest to widest): UltraCondensed, ExtraCondensed, Condensed, SemiCondensed, Normal, SemiExpanded, Expanded, ExtraExpanded or UltraExpanded. The specific interpretation of these values varies from font to font. EXAMPLE 2
© ISO 2020 – All rights reserved
For the font Times Bold Italic, the FontFamily is Times.
Condensed in one font might appear most similar to Normal in another.
343
ISO 32000-2:2020(E)
Key
Type
Value
FontWeight
number
(Optional; PDF 1.5) The weight (thickness) component of the fullyqualified font name or font specifier. If present, the value shall be one of 100, 200, 300, 400, 500, 600, 700, 800, or 900, where each number indicates a weight that is at least as dark as its predecessor. A value of 400 shall indicate a normal weight; 700 shall indicate bold. The specific interpretation of these values varies from font to font. EXAMPLE 3
300 in one font might appear most similar to 500 in another.
Flags
integer
(Required) A collection of flags defining various characteristics of the font (see 9.8.2, "Font descriptor flags").
FontBBox
rectangle
(Required except for Type 3 fonts) A rectangle (see 7.9.5, "Rectangles"), expressed in the glyph coordinate system, that shall specify the font bounding box. This should be the smallest rectangle enclosing the shape that would result if all of the glyphs of the font were placed with their origins coincident and then filled.
ItalicAngle
number
(Required) The angle, expressed in degrees counterclockwise from the vertical, of the dominant vertical strokes of the font. EXAMPLE 4
The 9-o’clock position is 90 degrees, and the 3-o’clock position is –90 degrees.
The value shall be negative for fonts that slope to the right, as almost all italic fonts do Ascent
number
(Required, except for Type 3 fonts) The maximum height above the baseline reached by glyphs in this font. The height of glyphs for accented characters shall be excluded.
Descent
number
(Required, except for Type 3 fonts) The maximum depth below the baseline reached by glyphs in this font. The value shall be a negative number.
Leading
number
(Optional) The spacing between baselines of consecutive lines of text. Default value: 0.
CapHeight
number
(Required for fonts that have Latin characters, except for Type 3 fonts) The vertical coordinate of the top of flat capital letters, measured from the baseline.
XHeight
number
(Optional) The font’s x height: the vertical coordinate of the top of flat nonascending lowercase letters (like the letter x), measured from the baseline, in fonts that have Latin characters. Default value: 0.
StemV
number
(Required except for Type 3 fonts) The thickness measured horizontally, of the dominant vertical stems of glyphs in the font. Values shall be positive. A value of 0 indicates an unknown stem thickness.
StemH
number
(Optional) The thickness measured vertically of the dominant horizontal stems of glyphs in the font. Values shall be positive. A value of 0 indicates an unknown stem thickness. Default value: 0.
AvgWidth
number
(Optional) The average width of glyphs in the font. Default value: 0.
344
© ISO 2020 – All rights reserved
ISO 32000-2:2020(E)
Key
Type
Value
MaxWidth
number
(Optional) The maximum width of glyphs in the font. Default value: 0.
MissingWidth
number
(Optional) The width to use for character codes whose widths are not specified in a font dictionary’s Widths array. This shall have a predictable effect only if all such codes map to glyphs whose actual widths are the same as the value of the MissingWidth entry. Default value: 0.
FontFile
stream
(Optional) A stream containing a Type 1 font program (see 9.9, "Embedded font programs").
FontFile2
stream
(Optional; PDF 1.1) A stream containing a TrueType font program (see 9.9, "Embedded font programs").
FontFile3
stream
(Optional; PDF 1.2) A stream containing a font program whose format is specified by the Subtype entry in the stream dictionary (see "Table 124 — Embedded font organisation for various font types").
CharSet
ASCII string or (Optional; meaningful only in Type 1 fonts; PDF 1.1; deprecated in PDF 2.0) A string listing the character names defined in a font subset. The names byte string in this string shall be in PDF syntax — that is, each name preceded by a slash (/). The names may appear in any order. The name .notdef shall be omitted; it shall exist in the font subset. If this entry is absent, the only indication of a font subset shall be the subset tag in the FontName entry (see 9.9.2, "Font subsets").
At most, only one of the FontFile, FontFile2, and FontFile3 entries shall be present.
9.8.2 Font descriptor flags The value of the Flags entry in a font descriptor shall be an unsigned 32-bit integer containing flags specifying various characteristics of the font. Bit positions within the flag word are numbered from 1 (low-order) to 32 (high-order). "Table 121 — Font flags" shows the meanings of the flags; all undefined flag bits are reserved and shall be set to 0 by PDF writers. "Figure 63 — Characteristics represented in the Flags entry of a font descriptor" shows examples of fonts with these characteristics. Table 121 — Font flags Bit position
Name
Meaning
1
FixedPitch
All glyphs have the same width (as opposed to proportional or variable-pitch fonts, which have different widths).
2
Serif
Glyphs have serifs, which are short strokes drawn at an angle on the top and bottom of glyph stems. (Sans serif fonts do not have serifs.)
3
Symbolic
Font contains glyphs outside the Standard Latin character set. This flag and the Nonsymbolic flag shall not both be set or both be clear.
4
Script
Glyphs resemble cursive handwriting.
© ISO 2020 – All rights reserved
345
ISO 32000-2:2020(E)
Bit position
Name
Meaning
6
Nonsymbolic Font uses the Standard Latin character set or a subset of it. This flag and the Symbolic flag shall not both be set or both be clear.
7
Italic
Glyphs have dominant vertical strokes that are slanted.
17
AllCap
Font contains no lowercase letters; typically used for display purposes, such as for titles or headlines.
18
SmallCap
Font contains both uppercase and lowercase letters. The uppercase letters are similar to those in the regular version of the same typeface family. The glyphs for the lowercase letters have the same shapes as the corresponding uppercase letters, but they are sized and their proportions adjusted so that they have the same size and stroke weight as lowercase glyphs in the same typeface family.
19
ForceBold
See description after Note 1 in this subclause.
The Nonsymbolic flag (bit 6 in the Flags entry) indicates that the font’s character set is the Standard Latin character set (or a subset of it) and that it uses the standard names for those glyphs. This character set is shown in D.2, "Latin character set and encodings". If the font contains any glyphs outside this set, the Symbolic flag shall be set and the Nonsymbolic flag shall be clear. In other words, any font whose character set is not a subset of the Standard character set is considered to be symbolic. This influences the font’s default base encoding and may affect a PDF processor’s font substitution strategies. The use of the two flags to represent a single binary choice is a historical accident. A PDF processor should always check the Symbolic flag to determine whether the state is Symbolic or NonSymbolic. PDF writers should still set the NonSymbolic flag to be the inverse of the Symbolic flag for backward compatibility. NOTE 1
This classification of nonsymbolic and symbolic fonts is peculiar to PDF. A font can contain additional characters that are used in Latin writing systems but are outside the Standard Latin character set; PDF considers such a font to be symbolic.
The ForceBold flag (bit 19) shall determine whether bold glyphs shall be painted with extra pixels even at very small text sizes by a PDF processor. If the ForceBold flag is set, features of bold glyphs may be thickened at small text sizes. NOTE 2
346
Typically, when glyphs are painted at small sizes on very low-resolution devices such as display screens, features of bold glyphs can appear only 1 pixel wide. Because this is the minimum feature width on a pixel-based device, ordinary (nonbold) glyphs also appear with 1-pixel-wide features and therefore cannot be distinguished from bold glyphs.
© ISO 2020 – All rights reserved
ISO 32000-2:2020(E)
Figure 63 — Characteristics represented in the Flags entry of a font descriptor EXAMPLE
This code sample illustrates a font descriptor whose Flags entry has the Serif, Nonsymbolic, and ForceBold flags (bits 2, 6, and 19) set.
7 0 obj <</Type /FontDescriptor /FontName /AGaramond-Semibold /Flags 262178 /FontBBox [-177 -269 1123 866] /MissingWidth 255 /StemV 105 /StemH 45 /CapHeight 660 /XHeight 394 /Ascent 720 /Descent -270 /Leading 83 /MaxWidth 1212 /AvgWidth 478 /ItalicAngle 0
endobj
%Bits 2, 6, and 19
9.8.3 Font descriptors for CIDFonts 9.8.3.1
General
In addition to the entries in "Table 120 — Entries common to all font descriptors", the FontDescriptor dictionaries of CIDFonts may contain the entries listed in "Table 122 — Additional font descriptor entries for CIDFonts". © ISO 2020 – All rights reserved
347
ISO 32000-2:2020(E)
Table 122 — Additional font descriptor entries for CIDFonts Key
Type
Value
Style
dictionary
(Optional) A dictionary containing entries that describe the style of the glyphs in the font (see 9.8.3.2, "Style").
Lang
name
(Optional; PDF 1.5) A name specifying the language of the font, which may be used for encodings where the language is not implied by the encoding itself. The value shall be a Language-Tag as defined in BCP 47. If this entry is absent, such absence provides no information as to the language of the document; in particular, an absence of this entry does not by itself mean the language of the document is unknown.
FD
dictionary
(Optional) A dictionary whose keys identify a class of glyphs in a CIDFont. Each value shall be a dictionary containing entries that shall override the corresponding values in the main font descriptor dictionary for that class of glyphs (see 9.8.3.3, "FD").
CIDSet
stream
(Optional; deprecated in PDF 2.0) A stream identifying which CIDs are present in the CIDFont file. If this entry is present, the CIDFont shall contain only a subset of the glyphs in the character collection defined by the CIDSystemInfo dictionary. If it is absent, the only indication of a CIDFont subset shall be the subset tag in the FontName entry (see 9.9.2, "Font subsets"). The stream’s data shall be organised as a table of bits indexed by CID. The bits shall be stored in bytes with the high-order bit first. Each bit shall correspond to a CID. The most significant bit of the first byte shall correspond to CID 0, the next bit to CID 1, and so on.
9.8.3.2
Style
The Style dictionary contains entries that define style attributes and values for the CIDFont. Only the Panose entry is defined. The value of Panose shall be a 12-byte string consisting of these elements: •
The font family class and subclass ID bytes, given in the FamilyClass field of the "OS/2" table in a TrueType font. This field is documented in Microsoft’s TrueType 1.0 Font Files Technical Specification.
•
Ten bytes for the PANOSE classification number for the font. The PANOSE classification system is documented in Hewlett-Packard Company’s PANOSE Classification Metrics Guide.
See 2, "Normative references" for more information about these documents. EXAMPLE
This is an example of a Style entry in the font descriptor:
/Style <</Panose <01 05 02 02 03 00 00 00 00 00 00 00>>>
9.8.3.3
FD
A CIDFont may be made up of different classes of glyphs, each class requiring different sets of the fontwide attributes that appear in font descriptors.
348
© ISO 2020 – All rights reserved
ISO 32000-2:2020(E)
EXAMPLE 1
Latin glyphs, for example, may require different attributes than kanji glyphs.
The font descriptor shall define a set of default attributes that apply to all glyphs in the CIDFont. The FD entry in the font descriptor shall contain exceptions to these defaults. The key for each entry in an FD dictionary shall be the name of a class of glyphs — that is, a particular subset of the CIDFont’s character collection. The entry’s value shall be a font descriptor whose contents shall override the font-wide attributes for that class only. This font descriptor shall contain entries for metric information only; it shall not include FontFile, FontFile2, FontFile3, or any of the entries listed in “Table 120 — Entries common to all font descriptors”. The FD dictionary should contain at least the metrics for the proportional Latin glyphs. With the information for these glyphs, a more accurate substitution font can be created. The names of the glyph classes depend on the character collection, as identified by the Registry, Ordering, and Supplement entries in the CIDSystemInfo dictionary. "Table 123 — Glyph classes in CJK fonts" lists the valid keys for the Adobe-GB1, Adobe-CNS1, Adobe-Japan1, Adobe-Japan2 (deprecated in PDF 2.0 (2020)), Adobe-Korea1 (deprecated in PDF 2.0 (2020)) and Adobe-KR (added in PDF 2.0 (2020)) character collections. Table 123 — Glyph classes in CJK fonts Character Collection
Class
Glyphs in Class
Adobe-GB1
Alphabetic Dingbats Generic Hanzi HRoman HRomanRot Kana Proportional ProportionalRot
Full-width Latin, Greek, and Cyrillic glyphs Special symbols Typeface-independent glyphs, such as line-drawing Full-width hanzi (Chinese) glyphs Half-width Latin glyphs Same as HRoman but rotated for use in vertical writing Japanese kana (katakana and hiragana) glyphs Proportional Latin glyphs Same as Proportional but rotated for use in vertical writing
Adobe-CNS1
Alphabetic Dingbats Generic Hanzi HRoman HRomanRot Kana Proportional ProportionalRot
Full-width Latin, Greek, and Cyrillic glyphs Special symbols Typeface-independent glyphs, such as line-drawing Full-width hanzi (Chinese) glyphs Half-width Latin glyphs Same as HRoman but rotated for use in vertical writing Japanese kana (katakana and hiragana) glyphs Proportional Latin glyphs Same as Proportional but rotated for use in vertical writing
© ISO 2020 – All rights reserved
349
ISO 32000-2:2020(E)
Character Collection
Class
Glyphs in Class
Adobe-Japan1
Alphabetic AlphaNum Dingbats DingbatsRot Generic GenericRot HKana HKanaRot HRoman HRomanRot Kana Kanji Proportional ProportionalRot Ruby
Full-width Latin, Greek, and Cyrillic glyphs Numeric glyphs Special symbols Same as Dingbats but rotated for use in vertical writing Typeface-independent glyphs, such as line-drawing Same as Generic but rotated for use in vertical writing Half-width kana (katakana and hiragana) glyphs Same as HKana but rotated for use in vertical writing Half-width Latin glyphs Same as HRoman but rotated for use in vertical writing Full-width kana (katakana and hiragana) glyphs Full-width kanji (Chinese) glyphs Proportional Latin glyphs Same as Proportional but rotated for use in vertical writing Glyphs used for setting ruby (small glyphs that serve to annotate other glyphs with meanings or readings)
Adobe-Japan2 (deprecated in PDF 2.0 (2020))
Alphabetic Dingbats HojoKanji
Full-width Latin, Greek, and Cyrillic glyphs Special symbols Full-width kanji glyphs
Adobe-Korea1 (deprecated in PDF 2.0 (2020)) Adobe-KR (added in PDF 2.0 (2020))
Alphabetic Dingbats Generic Hangul Hanja HRoman HRomanRot Kana Proportional ProportionalRot
Full-width Latin, Greek, and Cyrillic glyphs Special symbols Typeface-independent glyphs, such as line-drawing Hangul and jamo glyphs Full-width hanja (Chinese) glyphs Half-width Latin glyphs Same as HRoman but rotated for use in vertical writing Japanese kana (katakana and hiragana) glyphs Proportional Latin glyphs Same as Proportional but rotated for use in vertical writing
EXAMPLE 2 /FD
This example illustrates an FD dictionary containing two entries. <</Proportional 25 0 R /HKana 26 0 R
25 0 obj <</Type /FontDescriptor /FontName /HeiseiMin-W3-Proportional /Flags 2 /AvgWidth 478 /MaxWidth 1212 /MissingWidth 250 /StemV 105 /StemH 45 /CapHeight 660 /XHeight 394 /Ascent 720
350
© ISO 2020 – All rights reserved
ISO 32000-2:2020(E)
/Descent -270 /Leading 83
endobj 26 0 obj <</Type /FontDescriptor /FontName /HeiseiMin-W3-HKana /Flags 3 /AvgWidth 500 /MaxWidth 500 /MissingWidth 500 /StemV 50 /StemH 75 /Ascent 720 /Descent 0 /Leading 83
endobj
Navigation: PDF20-Spec-09-Composite-Fonts | PDF20-Spec-Index | PDF20-Spec-09-Embedded-Fonts