次の方法で共有


OS/2 — OS/2 and Windows Metrics Table (OpenType 1.8.2)

The OS/2 table consists of a set of metrics and other data that are required in OpenType fonts.

OS/2 Table Formats

Six versions of the OS/2 table have been defined: versions 0 to 5. The format of version 5 is as follows:

Type Name of Entry Comments
uint16 version 0x0005
int16 xAvgCharWidth
uint16 usWeightClass
uint16 usWidthClass
uint16 fsType
int16 ySubscriptXSize
int16 ySubscriptYSize
int16 ySubscriptXOffset
int16 ySubscriptYOffset
int16 ySuperscriptXSize
int16 ySuperscriptYSize
int16 ySuperscriptXOffset
int16 ySuperscriptYOffset
int16 yStrikeoutSize
int16 yStrikeoutPosition
int16 sFamilyClass
uint8 panose[10]
uint32 ulUnicodeRange1 Bits 0–31
uint32 ulUnicodeRange2 Bits 32–63
uint32 ulUnicodeRange3 Bits 64–95
uint32 ulUnicodeRange4 Bits 96–127
Tag achVendID
uint16 fsSelection
uint16 usFirstCharIndex
uint16 usLastCharIndex
int16 sTypoAscender
int16 sTypoDescender
int16 sTypoLineGap
uint16 usWinAscent
uint16 usWinDescent
uint32 ulCodePageRange1 Bits 0–31
uint32 ulCodePageRange2 Bits 32–63
int16 sxHeight
int16 sCapHeight
uint16 usDefaultChar
uint16 usBreakChar
uint16 usMaxContext
uint16 usLowerOpticalPointSize
uint16 usUpperOpticalPointSize

Versions 0 to 4 were defined in earlier versions of the OpenType or TrueType specifications.

All versions are supported, but use of version 4 or later is recommended.

OS/2 Field Details

version

Format:uint16
Units:n/a
Title:OS/2 table version number.
Description:The version number for the OS/2 table, = 5.
Comments:The version number allows for identification of the precise contents and layout for the OS/2 table.

xAvgCharWidth

Format: int16
Units: Pels / em units
Title: Average weighted escapement.
Description: The Average Character Width parameter specifies the arithmetic average of the escapement (width) of all non-zero width glyphs in the font.
Comments: The value for xAvgCharWidth is calculated by obtaining the arithmetic average of the width of all non-zero width glyphs in the font. Furthermore, it is strongly recommended that implementers do not rely on this value for computing layout for lines of text, especially for cases where complex scripts are used.

usWeightClass

Format: uint16
Title: Weight class.
Description: Indicates the visual weight (degree of blackness or thickness of strokes) of the characters in the font. Values from 1 to 1000 are valid.
Comments: usWeightClass values use the same scale as the 'wght' axis that is used in the 'fvar' table of variable fonts and in the 'STAT' table. While integer values from 1 to 1000 are supported, some legacy platforms may have limitations on supported values. The following are commonly-used values:
Value Description C Definition (from windows.h)
100 Thin FW_THIN
200 Extra-light (Ultra-light) FW_EXTRALIGHT
300 Light FW_LIGHT
400 Normal (Regular) FW_NORMAL
500 Medium FW_MEDIUM
600 Semi-bold (Demi-bold) FW_SEMIBOLD
700 Bold FW_BOLD
800 Extra-bold (Ultra-bold) FW_EXTRABOLD
900 Black (Heavy) FW_BLACK

usWidthClass

Format: uint16
Title: Width class.
Description: Indicates a relative change from the normal aspect ratio (width to height ratio) as specified by a font designer for the glyphs in a font.
Comments:

Although every character in a font may have a different numeric aspect ratio, each character in a font of normal width has a relative aspect ratio of one. When a new type style is created of a different width class (either by a font designer or by some automated means) the relative aspect ratio of the characters in the new font is some percentage greater or less than those same characters in the normal font — it is this difference that this parameter specifies.

The valid usWidthClass values are shown in the following table. Note that the usWidthClass values are related to but distinct from the scale for the 'wdth' axis that is used in the 'fvar' table of variable fonts and in the 'STAT' table. The “% of normal” column in the following table provides a mapping from usWidthClass values 1 – 9 to 'wdth' values.

Value Description C Definition % of normal
1 Ultra-condensed FWIDTH_ULTRA_CONDENSED 50
2 Extra-condensed FWIDTH_EXTRA_CONDENSED 62.5
3 Condensed FWIDTH_CONDENSED 75
4 Semi-condensed FWIDTH_SEMI_CONDENSED 87.5
5 Medium (normal) FWIDTH_NORMAL 100
6 Semi-expanded FWIDTH_SEMI_EXPANDED 112.5
7 Expanded FWIDTH_EXPANDED 125
8 Extra-expanded FWIDTH_EXTRA_EXPANDED 150
9 Ultra-expanded FWIDTH_ULTRA_EXPANDED 200

fsType

Format: uint16
Title: Type flags.
Description: Indicates font embedding licensing rights for the font. Embeddable fonts may be stored in a document. When a document with embedded fonts is opened on a system that does not have the font installed (the remote system), the embedded font may be loaded for temporary (and in some cases, permanent) use on that system by an embedding-aware application. Embedding licensing rights are granted by the vendor of the font.

The OpenType Font Embedding DLL Specification and DLL release notes describe the APIs used to implement support for OpenType font embedding and loading. Applications that implement support for font embedding, either through use of the Font Embedding DLL or through other means, must not embed fonts which are not licensed to permit embedding. Further, applications loading embedded fonts for temporary use (see Preview & Print and Editable embedding below) must delete the fonts when the document containing the embedded font is closed.

This version of the OS/2 table makes bits 0 - 3 a set of exclusive bits. In other words, at most one bit in this range may be set at a time. The purpose is to remove misunderstandings caused by previous behavior of using the least restrictive of the bits that are set.
Bit Bit Mask Description
  0x0000 Installable Embedding: No fsType bit is set. Thus fsType is zero.
Fonts with this setting indicate that they may be embedded and permanently installed on the remote system by an application. The user of the remote system acquires the identical rights, obligations and licenses for that font as the original purchaser of the font, and is subject to the same end-user license agreement, copyright, design patent, and/or trademark as was the original purchaser.
0 0x0001 Reserved, must be zero.
1 0x0002 Restricted License embedding: Fonts that have only this bit set must not be modified, embedded or exchanged in any manner without first obtaining permission of the legal owner.
Caution: For Restricted License embedding to take effect, it must be the only level of embedding selected.
2 0x0004 Preview & Print embedding: When this bit is set, the font may be embedded, and temporarily loaded on the remote system. Documents containing Preview & Print fonts must be opened “read-only;” no edits can be applied to the document.
3 0x0008 Editable embedding: When this bit is set, the font may be embedded but must only be installed temporarily on other systems. In contrast to Preview & Print fonts, documents containing Editable fonts may be opened for reading, editing is permitted, and changes may be saved.
4-7   Reserved, must be zero.
8 0x0100 No subsetting: When this bit is set, the font may not be subsetted prior to embedding. Other embedding restrictions specified in bits 0-3 and 9 also apply.
9 0x0200 Bitmap embedding only: When this bit is set, only bitmaps contained in the font may be embedded. No outline data may be embedded. If there are no bitmaps available in the font, then the font is considered unembeddable and the embedding services will fail. Other embedding restrictions specified in bits 0-3 and 8 also apply.
10-15   Reserved, must be zero.

ySubscriptXSize

Format: int16
Units: Font design units
Title: Subscript horizontal font size.
Description: The recommended horizontal size in font design units for subscripts for this font.
Comments: If a font has two recommended sizes for subscripts, e.g., numerics and other, the numeric sizes should be stressed. This size field maps to the em square size of the font being used for a subscript. The horizontal font size specifies a font designer’s recommended horizontal font size for subscript characters associated with this font. If a font does not include all of the required subscript characters for an application, and the application can substitute characters by scaling the character of a font or by substituting characters from another font, this parameter specifies the recommended em square for those subscript characters.

For example, if the em square for a font is 2048 and ySubScriptXSize is set to 205, then the horizontal size for a simulated subscript character would be 1/10th the size of the normal character.

ySubscriptYSize

Format: int16
Units: Font design units
Title: Subscript vertical font size.
Description: The recommended vertical size in font design units for subscripts for this font.
Comments: If a font has two recommended sizes for subscripts, e.g. numerics and other, the numeric sizes should be stressed. This size field maps to the emHeight of the font being used for a subscript. The horizontal font size specifies a font designer’s recommendation for horizontal font size of subscript characters associated with this font. If a font does not include all of the required subscript characters for an application, and the application can substitute characters by scaling the characters in a font or by substituting characters from another font, this parameter specifies the recommended horizontal EmInc for those subscript characters.

For example, if the em square for a font is 2048 and ySubScriptYSize is set to 205, then the vertical size for a simulated subscript character would be 1/10th the size of the normal character.

ySubscriptXOffset

Format: int16
Units: Font design units
Title: Subscript x offset.
Description: The recommended horizontal offset in font design untis for subscripts for this font.
Comments: The Subscript X Offset parameter specifies a font designer’s recommended horizontal offset -- from the character origin of the font to the character origin of the subscript’s character -- for subscript characters associated with this font. If a font does not include all of the required subscript characters for an application, and the application can substitute characters, this parameter specifies the recommended horizontal position from the character escapement point of the last character before the first subscript character. For upright characters, this value is usually zero; however, if the characters of a font have an incline (italic characters) the reference point for subscript characters is usually adjusted to compensate for the angle of incline.

ySubscriptYOffset

Format: int16
Units: Font design units
Title: Subscript y offset.
Description: The recommended vertical offset in font design units from the baseline for subscripts for this font.
Comments: The Subscript Y Offset parameter specifies a font designer’s recommended vertical offset from the character baseline to the character baseline for subscript characters associated with this font. Values are expressed as a positive offset below the character baseline. If a font does not include all of the required subscript for an application, this parameter specifies the recommended vertical distance below the character baseline for those subscript characters.

ySuperscriptXSize

Format: int16
Units: Font design units
Title: Superscript horizontal font size.
Description: The recommended horizontal size in font design units for superscripts for this font.
Comments: If a font has two recommended sizes for subscripts, e.g., numerics and other, the numeric sizes should be stressed. This size field maps to the em square size of the font being used for a subscript. The horizontal font size specifies a font designer’s recommended horizontal font size for superscript characters associated with this font. If a font does not include all of the required superscript characters for an application, and the application can substitute characters by scaling the character of a font or by substituting characters from another font, this parameter specifies the recommended em square for those superscript characters.

For example, if the em square for a font is 2048 and ySuperScriptXSize is set to 205, then the horizontal size for a simulated superscript character would be 1/10th the size of the normal character.

ySuperscriptYSize

Format: int16
Units: Font design units
Title: Superscript vertical font size.
Description: The recommended vertical size in font design units for superscripts for this font.
Comments: If a font has two recommended sizes for subscripts, e.g., numerics and other, the numeric sizes should be stressed. This size field maps to the emHeight of the font being used for a subscript. The vertical font size specifies a font designer’s recommended vertical font size for superscript characters associated with this font. If a font does not include all of the required superscript characters for an application, and the application can substitute characters by scaling the character of a font or by substituting characters from another font, this parameter specifies the recommended EmHeight for those superscript characters.

For example, if the em square for a font is 2048 and ySuperScriptYSize is set to 205, then the vertical size for a simulated superscript character would be 1/10th the size of the normal character.

ySuperscriptXOffset

Format: int16
Units: Font design units
Title: Superscript x offset.
Description: The recommended horizontal offset in font design units for superscripts for this font.
Comments: The Superscript X Offset parameter specifies a font designer’s recommended horizontal offset -- from the character origin to the superscript character’s origin for the superscript characters associated with this font. If a font does not include all of the required superscript characters for an application, this parameter specifies the recommended horizontal position from the escapement point of the character before the first superscript character. For upright characters, this value is usually zero; however, if the characters of a font have an incline (italic characters) the reference point for superscript characters is usually adjusted to compensate for the angle of incline.

ySuperscriptYOffset

Format: int16
Units: Font design units
Title: Superscript y offset.
Description: The recommended vertical offset in font design units from the baseline for superscripts for this font.
Comments: The Superscript Y Offset parameter specifies a font designer’s recommended vertical offset -- from the character baseline to the superscript character’s baseline associated with this font. Values for this parameter are expressed as a positive offset above the character baseline. If a font does not include all of the required superscript characters for an application, this parameter specifies the recommended vertical distance above the character baseline for those superscript characters.

yStrikeoutSize

Format: int16
Units: Font design units
Title: Strikeout size.
Description: Width of the strikeout stroke in font design units.
Comments: This field should normally be the width of the em dash for the current font. If the size is one, the strikeout line will be the line represented by the strikeout position field. If the value is two, the strikeout line will be the line represented by the strikeout position and the line immediately above the strikeout position. For a Roman font with a 2048 em square, 102 is suggested.

yStrikeoutPosition

Format: int16
Units: Font design units
Title: Strikeout position.
Description: The position of the top of the strikeout stroke relative to the baseline in font design units.
Comments: Positive values represent distances above the baseline, while negative values represent distances below the baseline. A value of zero falls directly on the baseline, while a value of one falls one pel above the baseline. The value of strikeout position should not interfere with the recognition of standard characters, and therefore should not line up with crossbars in the font. For a Roman font with a 2048 em square, 460 is suggested.

sFamilyClass

Format: int16
Title: Font-family class and subclass.
Description: This parameter is a classification of font-family design.
Comments: The font class and font subclass are registered values assigned by IBM to each font family. This parameter is intended for use in selecting an alternate font when the requested font is not available. The font class is the most general and the font subclass is the most specific. The high byte of this field contains the family class, while the low byte contains the family subclass. More information about this field.

Panose

Format: uint8[10]
Title: PANOSE classification number
International: Additional specifications are required for PANOSE to classify non-Latin character sets.
Description: This 10-byte series of numbers is used to describe the visual characteristics of a given typeface. These characteristics are then used to associate the font with other fonts of similar appearance having different names. The variables for each digit are listed below. The Panose values are fully described in the Panose “greybook” reference, currently owned by Monotype Imaging.
Comments: The PANOSE definition contains ten digits each of which currently describes up to sixteen variations. Windows uses bFamilyType, bSerifStyle and bProportion in the font mapper to determine family type. It also uses bProportion to determine if the font is monospaced. If the font is a symbol font, the first byte of the PANOSE number (bFamilyType) must be set to “pictorial.” The specification for assigning PANOSE values can be found at https://monotype.github.io/panose/.
Type Name
uint8 bFamilyType;
uint8 bSerifStyle;
uint8 bWeight;
uint8 bProportion;
uint8 bContrast;
uint8 bStrokeVariation;
uint8 bArmStyle;
uint8 bLetterform;
uint8 bMidline;
uint8 bXHeight;

In a variable font that uses OpenType Font Variation mechanisms, there is no way to represent different PANOSE values for different instances supported by the font. The PANOSE values can be set based on the default instance.

ulUnicodeRange1 (Bits 0–31)
ulUnicodeRange2 (Bits 32–63)
ulUnicodeRange3 (Bits 64–95)
ulUnicodeRange4 (Bits 96–127)

Format: uint32[4] — total 128 bits.
Title: Unicode Character Range
Description: This field is used to specify the Unicode blocks or ranges encompassed by the font file in the 'cmap' subtables for platform 3, encoding ID 1 (Microsoft platform, Unicode) and platform 3, encoding ID 10 (Microsoft platform, UCS-4). If the bit is set (1) then the Unicode range is considered functional. If the bit is clear (0) then the range is not considered functional. Each of the bits is treated as an independent flag and the bits can be set in any combination. The determination of “functional” is left up to the font designer, although character set selection should attempt to be functional by ranges if at all possible.

All reserved fields must be zero. Each uint32 is in Big-Endian form. See ISO/IEC 10646 or the most recent version of the Unicode Standard for the list of Unicode ranges and characters.
Bit Unicode Range Block range
0 Basic Latin 0000-007F
1 Latin-1 Supplement 0080-00FF
2 Latin Extended-A 0100-017F
3 Latin Extended-B 0180-024F
4 IPA Extensions 0250-02AF
Phonetic Extensions 1D00-1D7F
Phonetic Extensions Supplement 1D80-1DBF
5 Spacing Modifier Letters 02B0-02FF
Modifier Tone Letters A700-A71F
6 Combining Diacritical Marks 0300-036F
Combining Diacritical Marks Supplement 1DC0-1DFF
7 Greek and Coptic 0370-03FF
8 Coptic 2C80-2CFF
9 Cyrillic 0400-04FF
Cyrillic Supplement 0500-052F
Cyrillic Extended-A 2DE0-2DFF
Cyrillic Extended-B A640-A69F
10 Armenian 0530-058F
11 Hebrew 0590-05FF
12 Vai A500-A63F
13 Arabic 0600-06FF
Arabic Supplement 0750-077F
14 NKo 07C0-07FF
15 Devanagari 0900-097F
16 Bengali 0980-09FF
17 Gurmukhi 0A00-0A7F
18 Gujarati 0A80-0AFF
19 Oriya 0B00-0B7F
20 Tamil 0B80-0BFF
21 Telugu 0C00-0C7F
22 Kannada 0C80-0CFF
23 Malayalam 0D00-0D7F
24 Thai 0E00-0E7F
25 Lao 0E80-0EFF
26 Georgian 10A0-10FF
Georgian Supplement 2D00-2D2F
27 Balinese 1B00-1B7F
28 Hangul Jamo 1100-11FF
29 Latin Extended Additional 1E00-1EFF
Latin Extended-C 2C60-2C7F
Latin Extended-D A720-A7FF
30 Greek Extended 1F00-1FFF
31 General Punctuation 2000-206F
Supplemental Punctuation 2E00-2E7F
32 Superscripts And Subscripts 2070-209F
33 Currency Symbols 20A0-20CF
34 Combining Diacritical Marks For Symbols 20D0-20FF
35 Letterlike Symbols 2100-214F
36 Number Forms 2150-218F
37 Arrows 2190-21FF
Supplemental Arrows-A 27F0-27FF
Supplemental Arrows-B 2900-297F
Miscellaneous Symbols and Arrows 2B00-2BFF
38 Mathematical Operators 2200-22FF
Supplemental Mathematical Operators 2A00-2AFF
Miscellaneous Mathematical Symbols-A 27C0-27EF
Miscellaneous Mathematical Symbols-B 2980-29FF
39 Miscellaneous Technical 2300-23FF
40 Control Pictures 2400-243F
41 Optical Character Recognition 2440-245F
42 Enclosed Alphanumerics 2460-24FF
43 Box Drawing 2500-257F
44 Block Elements 2580-259F
45 Geometric Shapes 25A0-25FF
46 Miscellaneous Symbols 2600-26FF
47 Dingbats 2700-27BF
48 CJK Symbols And Punctuation 3000-303F
49 Hiragana 3040-309F
50 Katakana 30A0-30FF
Katakana Phonetic Extensions 31F0-31FF
51 Bopomofo 3100-312F
Bopomofo Extended 31A0-31BF
52 Hangul Compatibility Jamo 3130-318F
53 Phags-pa A840-A87F
54 Enclosed CJK Letters And Months 3200-32FF
55 CJK Compatibility 3300-33FF
56 Hangul Syllables AC00-D7AF
57 Non-Plane 0 * D800-DFFF
58 Phoenician 10900-1091F
59 CJK Unified Ideographs 4E00-9FFF
CJK Radicals Supplement 2E80-2EFF
Kangxi Radicals 2F00-2FDF
Ideographic Description Characters 2FF0-2FFF
CJK Unified Ideographs Extension A 3400-4DBF
CJK Unified Ideographs Extension B 20000-2A6DF
Kanbun 3190-319F
60 Private Use Area (plane 0) E000-F8FF
61 CJK Strokes 31C0-31EF
CJK Compatibility Ideographs F900-FAFF
CJK Compatibility Ideographs Supplement 2F800-2FA1F
62 Alphabetic Presentation Forms FB00-FB4F
63 Arabic Presentation Forms-A FB50-FDFF
64 Combining Half Marks FE20-FE2F
65 Vertical Forms FE10-FE1F
CJK Compatibility Forms FE30-FE4F
66 Small Form Variants FE50-FE6F
67 Arabic Presentation Forms-B FE70-FEFF
68 Halfwidth And Fullwidth Forms FF00-FFEF
69 Specials FFF0-FFFF
70 Tibetan 0F00-0FFF
71 Syriac 0700-074F
72 Thaana 0780-07BF
73 Sinhala 0D80-0DFF
74 Myanmar 1000-109F
75 Ethiopic 1200-137F
Ethiopic Supplement 1380-139F
Ethiopic Extended 2D80-2DDF
76 Cherokee 13A0-13FF
77 Unified Canadian Aboriginal Syllabics 1400-167F
78 Ogham 1680-169F
79 Runic 16A0-16FF
80 Khmer 1780-17FF
Khmer Symbols 19E0-19FF
81 Mongolian 1800-18AF
82 Braille Patterns 2800-28FF
83 Yi Syllables A000-A48F
Yi Radicals A490-A4CF
84 Tagalog 1700-171F
Hanunoo 1720-173F
Buhid 1740-175F
Tagbanwa 1760-177F
85 Old Italic 10300-1032F
86 Gothic 10330-1034F
87 Deseret 10400-1044F
88 Byzantine Musical Symbols 1D000-1D0FF
Musical Symbols 1D100-1D1FF
Ancient Greek Musical Notation 1D200-1D24F
89 Mathematical Alphanumeric Symbols 1D400-1D7FF
90 Private Use (plane 15) F0000-FFFFD
Private Use (plane 16) 100000-10FFFD
91 Variation Selectors FE00-FE0F
Variation Selectors Supplement E0100-E01EF
92 Tags E0000-E007F
93 Limbu 1900-194F
94 Tai Le 1950-197F
95 New Tai Lue 1980-19DF
96 Buginese 1A00-1A1F
97 Glagolitic 2C00-2C5F
98 Tifinagh 2D30-2D7F
99 Yijing Hexagram Symbols 4DC0-4DFF
100 Syloti Nagri A800-A82F
101 Linear B Syllabary 10000-1007F
Linear B Ideograms 10080-100FF
Aegean Numbers 10100-1013F
102 Ancient Greek Numbers 10140-1018F
103 Ugaritic 10380-1039F
104 Old Persian 103A0-103DF
105 Shavian 10450-1047F
106 Osmanya 10480-104AF
107 Cypriot Syllabary 10800-1083F
108 Kharoshthi 10A00-10A5F
109 Tai Xuan Jing Symbols 1D300-1D35F
110 Cuneiform 12000-123FF
Cuneiform Numbers and Punctuation 12400-1247F
111 Counting Rod Numerals 1D360-1D37F
112 Sundanese 1B80-1BBF
113 Lepcha 1C00-1C4F
114 Ol Chiki 1C50-1C7F
115 Saurashtra A880-A8DF
116 Kayah Li A900-A92F
117 Rejang A930-A95F
118 Cham AA00-AA5F
119 Ancient Symbols 10190-101CF
120 Phaistos Disc 101D0-101FF
121 Carian 102A0-102DF
Lycian 10280-1029F
Lydian 10920-1093F
122 Domino Tiles 1F030-1F09F
Mahjong Tiles 1F000-1F02F
123-127 Reserved for process-internal usage

Note: * Setting bit 57 implies that there is at least one codepoint beyond the Basic Multilingual Plane that is supported by this font.

achVendID

Format: 4-byte Tag
Title: Font Vendor Identification
Description: The four character identifier for the vendor of the given type face.
Comments: This is not the royalty owner of the original artwork. This is the company responsible for the marketing and distribution of the typeface that is being classified. It is reasonable to assume that there will be 6 vendors of ITC Zapf Dingbats for use on desktop platforms in the near future (if not already). It is also likely that the vendors will have other inherent benefits in their fonts (more kern pairs, unregularized data, hand hinted, etc.). This identifier will allow for the correct vendor’s type to be used over another, possibly inferior, font file. The Vendor ID value is not required.

Microsoft has assigned values for some font suppliers as listed below. Uppercase vendor ID’s are reserved by Microsoft. Other suppliers can choose their own mixed case or lowercase ID’s, or leave the field blank.

For a list of registered Vendor id’s see our Registered ‘vendors’ links page.

fsSelection

Format: uint16
Title: Font selection flags.
Description: Contains information concerning the nature of the font patterns, as follows:
Bit # macStyle bit C definition Description
0 bit 1 ITALIC Font contains italic or oblique characters, otherwise they are upright.
1   UNDERSCORE Characters are underscored.
2   NEGATIVE Characters have their foreground and background reversed.
3   OUTLINED Outline (hollow) characters, otherwise they are solid.
4   STRIKEOUT Characters are overstruck.
5 bit 0 BOLD Characters are emboldened.
6   REGULAR Characters are in the standard weight/style for the font.
7   USE_TYPO_METRICS If set, it is strongly recommended to use OS/2.sTypoAscender - OS/2.sTypoDescender+ OS/2.sTypoLineGap as a value for default line spacing for this font.
8   WWS The font has 'name' table strings consistent with a weight/width/slope family without requiring use of 'name' IDs 21 and 22. (Please see more detailed description below.)
9   OBLIQUE Font contains oblique characters.
10–15   <reserved> Reserved; set to 0.
Comments:
  • All undefined bits must be zero.
  • Bits 1-4 are rarely used bits that indicate the font is primarily a decorative or special purpose font.
  • If bit 6 is set, then bits 0 and 5 must be clear, else the behavior is undefined. As noted above, the settings of bits 0 and 5 must be reflected in the macStyle bits in the 'head' table. While bit 6 on implies that bits 0 and 1 of macStyle are clear (along with bits 0 and 5 of fsSelection), the reverse is not true. Bits 0 and 1 of macStyle (and 0 and 5 of fsSelection) may be clear and that does not give any indication of whether or not bit 6 of fsSelection is clear (e.g., Arial Light would have all bits cleared; it is not the regular version of Arial).
  • Bit 7 was specified in OS/2 table v. 4. If fonts created with an earlier version of the OS/2 table are updated to the current version of the OS/2 table, then, in order to minimize potential reflow of existing documents which use the fonts, the bit would be set only for fonts for which using the OS/2.usWin* metrics for line height would yield significantly inferior results than using the OS/2.sTypo* values. New fonts, however, are not constrained by backward compatibility situations, and so are free to set this bit always.
  • If bit 8 is set in OS/2 table v. 4, then 'name' strings for family and subfamily are provided that are consistent with a weight/width/slope family model without requiring the use of 'name' IDs 21 or 22.
  • Many typographic families contains faces that differ only in one or more of the attributes weight, width and slope. Even though a family might have a large number of member faces, if the variations are in these attributes only, then family and subfamily names provided in the 'name' table using IDs 1 and 2 or 16 and 17 will be consistent with a weight/width/slope family model. If the names in these IDs are consistent with a weight/width/slope model, then bit 8 should be set, and 'name' entries for name IDs 21 and 22 should not be included.
  • Some typographic families include faces that differ in attributes other than weight, width or slope. For example, a family might include variations for “handwriting”, “caption”, “display”, “optical size”, etc. In this case, some of the member faces may differ from the Regular face only in weight, width or slope attributes, while other members will differ in relation to other attributes. Fonts for those member faces that differ from Regular only in weight, width or slope should have bit 8 set, and should not use name ID 21 or 22, as described above. But the fonts for those member faces that differ from Regular in terms of other attributes should not have bit 8 set, and they should use name IDs 21 and 22 to map these faces into a WWS-conformant family model.

    Thus, if a font has a v. 4 OS/2 table, bit 8 should be set if and only if 'name' entries for IDs 16 and 17 are consistent with the WWS model and entries for IDs 21 and 22 are not included. Conversely, if bit 8 is not set, that will be interpreted to mean that the names provided by IDs 16 and 17 are not consistent with the WWS model and that 'name' entries for IDs 21 and 22 are included.

    This bit must be unset in OS/2 table versions less than 4. In these cases, it is not possible to determine any information about the typographic family’s attributes by examining this bit.

    In this context, “typographic family” is the Microsoft Unicode string for name ID 16, if present, else the Microsoft Unicode string for name ID 1; “weight” is OS/2.usWeightClass; “width” is OS/2.usWidthClass; “slope” is OS/2.fsSelection bit 0 (ITALIC) and bit 9 (OBLIQUE).
  • If bit 9 is set in OS/2 table v. 4, then this font is to be considered an “oblique” style by processes which make a distinction between oblique and italic styles, e.g. Cascading Style Sheets font matching. For example, a font created by algorithmically slanting an upright face will set this bit.

    If unset in OS/2 table v. 4, then this font is not to be considered an “oblique” style. For example, a font that has a classic italic design will not set this bit.

    This bit must be unset in OS/2 table versions less than 4. In these cases, it is not possible to determine any information about this font’s attributes by examining this bit.

    This bit, unlike the ITALIC bit, is not related to style-linking for Windows GDI or Mac OS applications in a traditional four-member family of regular, italic, bold and bold italic.“. It may be set or unset independently of the ITALIC bit. In most cases, if OBLIQUE is set, then ITALIC will also be set, though this is not required.
  • Bit 15 is permanently reserved. It has been used in some legacy implementations and may result in special behavior in some implementations. Use of this bit is deprecated.

usFirstCharIndex

Format: uint16
Description: The minimum Unicode index (character code) in this font, according to the cmap subtable for platform ID 3 and platform- specific encoding ID 0 or 1. For most fonts supporting Win-ANSI or other character sets, this value would be 0x0020. This field cannot represent supplementary character values (codepoints greater than 0xFFFF). Fonts that support supplementary characters should set the value in this field to 0xFFFF if the minimum index value is a supplementary character.

usLastCharIndex

Format: uint16
Description: The maximum Unicode index (character code) in this font, according to the cmap subtable for platform ID 3 and encoding ID 0 or 1. This value depends on which character sets the font supports. This field cannot represent supplementary character values (codepoints greater than 0xFFFF). Fonts that support supplementary characters should set the value in this field to 0xFFFF.

sTypoAscender

Format: int16
Description: The typographic ascender for this font. Remember that this is not the same as the Ascender value in the 'hhea' table, which Apple defines in a far different manner. One good source for sTypoAscender in Latin based fonts is the Ascender value from an AFM file. For CJK fonts see below.

The suggested usage for sTypoAscender is that it be used in conjunction with unitsPerEm to compute a typographically correct default line spacing. The goal is to free applications from Macintosh or Windows-specific metrics which are constrained by backward compatibility requirements. These new metrics, when combined with the character design widths, will allow applications to lay out documents in a typographically correct and portable fashion. These metrics will be exposed through Windows APIs. Macintosh applications will need to access the 'sfnt' resource and parse it to extract this data from the “OS/2” table.

For CJK (Chinese, Japanese, and Korean) fonts that are intended to be used for vertical writing (in addition to horizontal writing), the required value for sTypoAscender is that which describes the top of the of the ideographic em-box. For example, if the ideographic em-box of the font extends from coordinates 0,-120 to 1000,880 (that is, a 1000x1000 box set 120 design units below the Latin baseline), then the value of sTypoAscender must be set to 880. Failing to adhere to these requirements will result in incorrect vertical layout.

Also see the Recommendations Section for more on this field.

sTypoDescender

Format: int16
Description: The typographic descender for this font. Remember that this is not the same as the Descender value in the 'hhea' table, which Apple defines in a far different manner. One good source for sTypoDescender in Latin based fonts is the Descender value from an AFM file. For CJK fonts see below.

The suggested usage for sTypoDescender is that it be used in conjunction with unitsPerEm to compute a typographically correct default line spacing. The goal is to free applications from Macintosh or Windows-specific metrics which are constrained by backward compatability requirements. These new metrics, when combined with the character design widths, will allow applications to lay out documents in a typographically correct and portable fashion. These metrics will be exposed through Windows APIs. Macintosh applications will need to access the 'sfnt' resource and parse it to extract this data from the “OS/2” table (unless Apple exposes the 'OS/2' table through a new API).

For CJK (Chinese, Japanese, and Korean) fonts that are intended to be used for vertical writing (in addition to horizontal writing), the required value for sTypoDescender is that which describes the bottom of the of the ideographic em-box. For example, if the ideographic em-box of the font extends from coordinates 0,-120 to 1000,880 (that is, a 1000x1000 box set 120 design units below the Latin baseline), then the value of sTypoDescender must be set to -120. Failing to adhere to these requirements will result in incorrect vertical layout.

Also see the Recommendations Section for more on this field.

sTypoLineGap

Format: int16
Description: The typographic line gap for this font. Remember that this is not the same as the LineGap value in the 'hhea' table, which Apple defines in a far different manner.

The suggested usage for sTypoLineGap is that it be used in conjunction with unitsPerEm to compute a typographically correct default line spacing. Typical values average 7-10% of units per em. The goal is to free applications from Macintosh or Windows-specific metrics which are constrained by backward compatability requirements (see chapter, “Recommendations for OpenType Fonts”). These new metrics, when combined with the character design widths, will allow applications to lay out documents in a typographically correct and portable fashion. These metrics will be exposed through Windows APIs. Macintosh applications will need to access the 'sfnt' resource and parse it to extract this data from the “OS/2” table (unless Apple exposes the 'OS/2' table through a new API)

usWinAscent

Format: uint16
Description: The ascender metric for Windows. This, too, is distinct from Apple’s Ascender value and from the usTypoAscender values. usWinAscent is computed as the yMax for all characters in the Windows ANSI character set. usWinAscent is used to compute the Windows font height and default line spacing. For platform 3 encoding 0 fonts, it is the same as yMax. Windows will clip the bitmap of any portion of a glyph that appears above this value. Some applications use this value to determine default line spacing. This is strongly discouraged. The typographic ascender, descender and line gap fields in conjunction with unitsPerEm should be used for this purpose. Developers should set this field keeping the above factors in mind.

If any clipping is unacceptable, then the value should be set to yMax.

However, if a developer desires to provide appropriate default line spacing using this field, for those applications that continue to use this field for doing so (against OpenType recommendations), then the value should be set appropriately. In such a case, it may result in some glyph bitmaps being clipped.

usWinDescent

Format: uint16
Description: The descender metric for Windows. This, too, is distinct from Apple’s Descender value and from the usTypoDescender values. usWinDescent is computed as the -yMin for all characters in the Windows ANSI character set. usWinDescent is used to compute the Windows font height and default line spacing. For platform 3 encoding 0 fonts, it is the same as -yMin. Windows will clip the bitmap of any portion of a glyph that appears below this value. Some applications use this value to determine default line spacing. This is strongly discouraged. The typographic ascender, descender and line gap fields in conjunction with unitsPerEm should be used for this purpose. Developers should set this field keeping the above factors in mind.

If any clipping is unacceptable, then the value should be set to yMin.

However, if a developer desires to provide appropriate default line spacing using this field, for those applications that continue to use this field for doing so (against OpenType recommendations), then the value should be set appropriately. In such a case, it may result in some glyph bitmaps being clipped.

ulCodePageRange1 Bits 0–31
ulCodePageRange2 Bits 32–63

Format: uint32[2] — total 64 bits.
Title: Code Page Character Range
Description: This field is used to specify the code pages encompassed by the font file in the 'cmap' subtable for platform 3, encoding ID 1 (Microsoft platform). If the font file is encoding ID 0, then the Symbol Character Set bit should be set. If the bit is set (1) then the code page is considered functional. If the bit is clear (0) then the code page is not considered functional. Each of the bits is treated as an independent flag and the bits can be set in any combination. The determination of “functional” is left up to the font designer, although character set selection should attempt to be functional by code pages if at all possible.

Symbol character sets have a special meaning. If the symbol bit (31) is set, and the font file contains a 'cmap' subtable for platform of 3 and encoding ID of 1, then all of the characters in the Unicode range 0xF000 - 0xF0FF (inclusive) will be used to enumerate the symbol character set. If the bit is not set, any characters present in that range will not be enumerated as a symbol character set.

All reserved fields must be zero. Each uint32 is in Big-Endian form.
Bit Code Page Description
0 1252 Latin 1
1 1250 Latin 2: Eastern Europe
2 1251 Cyrillic
3 1253 Greek
4 1254 Turkish
5 1255 Hebrew
6 1256 Arabic
7 1257 Windows Baltic
8 1258 Vietnamese
9–15 Reserved for Alternate ANSI
16 874 Thai
17 932 JIS/Japan
18 936 Chinese: Simplified chars--PRC and Singapore
19 949 Korean Wansung
20 950 Chinese: Traditional chars--Taiwan and Hong Kong
21 1361 Korean Johab
22-28 Reserved for Alternate ANSI & OEM
29 Macintosh Character Set (US Roman)
30 OEM Character Set
31 Symbol Character Set
32–47 Reserved for OEM
48 869 IBM Greek
49 866 MS-DOS Russian
50 865 MS-DOS Nordic
51 864 Arabic
52 863 MS-DOS Canadian French
53 862 Hebrew
54 861 MS-DOS Icelandic
55 860 MS-DOS Portuguese
56 857 IBM Turkish
57 855 IBM Cyrillic; primarily Russian
58 852 Latin 2
59 775 MS-DOS Baltic
60 737 Greek; former 437 G
61 708 Arabic; ASMO 708
62 850 WE/Latin 1
63 437 US

sxHeight

Format: int16
Description: This metric specifies the distance between the baseline and the approximate height of non-ascending lowercase letters measured in FUnits. This value would normally be specified by a type designer but in situations where that is not possible, for example when a legacy font is being converted, the value may be set equal to the top of the unscaled and unhinted glyph bounding box of the glyph encoded at U+0078 (LATIN SMALL LETTER X). If no glyph is encoded in this position the field should be set to 0.

This metric, if specified, can be used in font substitution: the xHeight value of one font can be scaled to approximate the apparent size of another.

sCapHeight

Format: int16
Description: This metric specifies the distance between the baseline and the approximate height of uppercase letters measured in FUnits. This value would normally be specified by a type designer but in situations where that is not possible, for example when a legacy font is being converted, the value may be set equal to the top of the unscaled and unhinted glyph bounding box of the glyph encoded at U+0048 (LATIN CAPITAL LETTER H). If no glyph is encoded in this position the field should be set to 0.

This metric, if specified, can be used in systems that specify type size by capital height measured in millimeters. It can also be used as an alignment metric; the top of a drop capital, for instance, can be aligned to the sCapHeight metric of the first line of text.

usDefaultChar

Format: uint16
Description: Whenever a request is made for a character that is not in the font, Windows provides this default character. If the value of this field is zero, glyph ID 0 is to be used for the default character otherwise this is the Unicode encoding of the glyph that Windows uses as the default character. This field cannot represent supplementary character values (codepoints greater than 0xFFFF), and so applications are strongly discouraged from using this field.

usBreakChar

Format: uint16
Description: This is the Unicode encoding of the glyph that Windows uses as the break character. The break character is used to separate words and justify text. Most fonts specify ‘space’ as the break character. This field cannot represent supplementary character values (codepoints greater than 0xFFFF) , and so applications are strongly discouraged from using this field.

usMaxContext

Format: uint16
Description: The maximum length of a target glyph context for any feature in this font. For example, a font which has only a pair kerning feature should set this field to 2. If the font also has a ligature feature in which the glyph sequence ‘f f i’ is substituted by the ligature ‘ffi’, then this field should be set to 3. This field could be useful to sophisticated line-breaking engines in determining how far they should look ahead to test whether something could change that effects the line breaking. For chaining contextual lookups, the length of the string (covered glyph) + (input sequence) + (lookahead sequence) should be considered.

usLowerOpticalPointSize

Format: uint16
Units: TWIPs
Description: This field is used for fonts with multiple optical styles.

This value is the lower value of the size range for which this font has been designed. The units for this field are TWIPs (one-twentieth of a point, or 1440 per inch). The value is inclusive — meaning that that font was designed to work best at this point size through, but not including, the point size indicated by usUpperOpticalPointSize. When used with other optical fonts that set usLowerOpticalPointSize and usUpperOpticalPointSize, it would be expected that another font has this same value as this entry in the usUpperOpticalPointSize field, unless this font is designed for the lowest size range. The smallest font in an optical size set should set this value to 0.When working across multiple optical fonts, there should be no intentional gaps or overlaps in the ranges. usLowerOpticalPointSize must be less than usUpperOpticalPointSize. The maximum valid value is 0xFFFE.

For fonts that were not designed for multiple optical styles, this field should be set to 0 (zero) and the corresponding usUpperOpticalPointSize set to 0xFFFF.

Note: Use of this field has been superseded by the 'STAT' table. See Recommendations Section for more information.

usUpperOpticalPointSize

Format: uint16
Units: TWIPs
Description: This field is used for fonts with multiple optical styles.

This value is the upper value of the size range for which this font has been designed. The units for this field are TWIPs (one-twentieth of a point, or 1440 per inch). The value is exclusive — meaning that that font was designed to work best below this point size down to the usLowerOpticalPointSize threshold. When used with other optical fonts that set usLowerOpticalPointSize and usUpperOpticalPointSize, it would be expected that another font has this same value as this entry in the usLowerOpticalPointSize field, unless this font is designed for the highest size range. The largest font in an optical size set should set this value to 0xFFFF, which is interpreted as infinity. When working across multiple optical fonts, there should be no intentional or overlaps left in the ranges. usUpperOpticalPointSize must be greater than usLowerOpticalPointSize. The minimum valid value for this field is 2 (two). The largest possible inclusive point size represented by this field is 3276.65 points, any higher values would be represented as infinity.

For fonts that were not designed for multiple optical styles, this field should be set to 0xFFFF and the corresponding usLowerOpticalPointSize set to 0 (zero).

Note: Use of this field has been superseded by the 'STAT' table. See Recommendations Section for more information.

OS/2 Table and OpenType Font Variations

In a variable font, various font-metric values within the OS/2 table may need to be adjusted for different variation instances. Variation data for OS/2 entries can be provided in the metrics variations ('MVAR') table. Different OS/2 entries are associated with particular variation data in the 'MVAR' table using value tags, as follows:

OS/2 entry Tag
sCapHeight 'cpht'
sTypoAscender 'hasc'
sTypoDescender 'hdsc'
sTypoLineGap 'hlgp'
sxHeight 'xhgt'
usWinAscent 'hcla'
usWinDescent 'hcld'
yStrikeoutPosition 'stro'
yStrikeoutSize 'strs'
ySubscriptXOffset 'sbxo'
ySubScriptXSize 'sbxs'
ySubscriptYOffset 'sbyo'
ySubscriptYSize 'sbys'
ySuperscriptXOffset 'spxo'
ySuperscriptXSize 'spxs'
ySuperscriptYOffset 'spyo'
ySuperscriptYSize 'spys'

Note: The usWeightClass and usWidthClass values are not adjusted by variation data since these correspond to 'wght' and 'wdth' variation axes that can be used to define a font’s variation space. Appropriate usWeightClass and usWidthClass values for a variation instance can be derived from 'wght' and 'wdth' user coordinates that are used to select a particular variation instance. For 'wdth' values greater than 200, the usWidthClass value is clamped to 9. See the discussion of the 'wght' and 'wdth' axes in the OpenType Design-Variation Axis Tag Registry for details on the relationship between these OS/2 fields and the corresponding design axes.

For general information on OpenType Font Variations, see the chapter, OpenType Font Variations Overview.