typedef struct _IFIMETRICS { ULONG cjThis; ULONG ulVersion; PTRDIFF dpwszFamilyName; PTRDIFF dpwszStyleName; PTRDIFF dpwszFaceName; PTRDIFF dpwszUniqueName; PTRDIFF dpFontSim; LONG lEmbedId; LONG lItalicAngle; LONG lCharBias; PTRDIFF dpCharSets; BYTE jWinCharSet; BYTE jWinPitchAndFamily; USHORT usWinWeight; ULONG flInfo; USHORT fsSelection; USHORT fsType; FWORD fwdUnitsPerEm; FWORD fwdLowestPPEm; FWORD fwdWinAscender; FWORD fwdWinDescender; FWORD fwdMacAscender; FWORD fwdMacDescender; FWORD fwdMacLineGap; FWORD fwdTypoAscender; FWORD fwdTypoDescender; FWORD fwdTypoLineGap; FWORD fwdAveCharWidth; FWORD fwdMaxCharInc; FWORD fwdCapHeight; FWORD fwdXHeight; FWORD fwdSubScriptXSize; FWORD fwdSubScriptYSize; FWORD fwdSubScriptXOffset; FWORD fwdSubScriptYOffset; FWORD fwdSuperScriptXSize; FWORD fwdSuperScriptYSize; FWORD fwdSuperScriptXOffset; FWORD fwdSuperScriptYOffset; FWORD fwdUnderscoreSize; FWORD fwdUnderscorePosition; FWORD fwdStrikeoutSize; FWORD fwdStrikeoutPosition; BYTE chFirstChar; BYTE chLastChar; BYTE chDefaultChar; BYTE chBreakChar; WCHAR wcFirstChar; WCHAR wcLastChar; WCHAR wcDefaultChar; WCHAR wcBreakChar; POINTL ptlBaseline; POINTL ptlAspect; POINTL ptlCaret; RECTL rclFontBox; BYTE achVendId[4]; ULONG cKerningPairs; ULONG ulPanoseCulture; PANOSE panose; } IFIMETRICS, *PIFIMETRICS;
The IFIMETRICS structure defines all the information for a given typeface that GDI can understand. Most of the members are FWORD values, which are signed 16-bit quantities in design space. If the font is a raster font, design space and device space are the same and a font unit is equivalent to the distance between pixels.
Value |
Meaning |
ANSI_CHARSET |
This font supports the Windows ANSI character set. |
SYMBOL_CHARSET |
This font supports the Windows symbol character set. |
SHIFTJIS_CHARSET |
This font supports the Shift-JIS character set. |
HANGEUL_CHARSET |
This font supports the Hangeul character set. |
CHINESEBIG5_CHARSET |
This font supports the Chinese Big 5 character set. |
OEM_CHARSET |
This font supports an OEM-specific character set. The OEM character set is system dependent. This is the value to be returned to the application in the lfCharSet member of the LOGFONT structure. |
Value |
Meaning |
FIXED_PITCH |
For fixed pitch fonts |
VARIABLE_PITCH |
For variable pitch fonts |
Bits 4 through 7 of this member specify the font family and can be one of the following values:
Value |
Meaning |
FF_DECORATIVE |
Novelty fonts, such as Old English. |
FF_DONTCARE |
Don’t care or unknown. |
FF_MODERN |
Fonts with constant stroke width (fixed-pitch), with or without serifs. Fixed-pitch fonts are usually modern, such as Pica, Elite, and Courier. |
FF_ROMAN |
Fonts with variable stroke width (proportionally spaced) and with serifs, such as Times Roman, Palatino, and Century Schoolbook. |
FF_SCRIPT |
Fonts designed to look like handwriting, such as Script and Cursive. |
FF_SWISS |
Fonts with variable stroke width (proportionally spaced) and without serifs, such as Helvetica and Swiss. |
Value |
Meaning |
FM_INFO_TECH_TRUETYPE | |
Indicates that the font is a TrueType font. | |
FM_INFO_TECH_BITMAP | |
Indicates that the font is a bitmap font. | |
FM_INFO_TECH_STROKE | |
Indicates that the font is based on a stroked font technology. This flag does not specify whether the paths returned for this font should be filled or stroked; the consumer should examine the FM_INFO_RETURNS_STROKES and FM_INFO_RETURNS_OUTLINES flags for this information. | |
FM_INFO_TECH_OUTLINE_NOT_TRUETYPE | |
Indicates that the font is based on a scalable font technology that uses outline paths, but is not based on TrueType. This flag does not specify whether the paths returned for this font should be filled or stroked; the consumer should examine the FM_INFO_RETURNS_STROKES and FM_INFO_RETURNS_OUTLINES flags for this information. | |
FM_INFO_ARB_XFORMS | |
Indicates that a font can be realized under a continuous range of two dimensional linear transformations. | |
FM_INFO_1BBP | |
Indicates that a glyph bitmap has a color depth of 1 bit per pixel. This must be set for the first version of Windows NT. | |
FM_INFO_INTEGER_WIDTH | |
Indicates that all glyphs have nonfractional advance widths. Bitmap fonts usually set this flag. | |
FM_INFO_CONSTANT_WIDTH | |
Indicates that all glyphs of the font under all realizations have the same value of character increment. If this flag is set, the FM_INFO_OPTICALLY_FIXED_PITCH flag must also be set. | |
FM_INFO_NOT_CONTIGUOUS | |
Indicates that the supported character set is not contiguous. | |
FM_INFO_PID_EMBEDDED | |
Indicates that the font is an embedded font; it is TrueType-specific and should not be set by other font providers. | |
FM_INFO_RETURNS_OUTLINES | |
Indicates that for any glyph supported by the driver, GDI can request a PATHOBJ structure that describes the outline of that glyph. If possible, when the outline is filled using GDI’s path filling conventions, the resulting bitmap should be identical to the bitmap returned by the driver. The FM_INFO_RETURNS_OUTLINES and FM_INFO_RETURNS_STOKES flags cannot be set concurrently. | |
FM_INFO_RETURNS_STROKES | |
Indicates that for any glyph supported by the drivers, GDI can request a PATHOBJ structure that describes the spline of the glyph. This path cannot be filled but can be stroked to give a representation of the glyph. The FM_INFO_RETURNS_OUTLINES and FM_INFO_RETURNS_STOKES flags cannot be set concurrently. | |
FM_INFO_RETURNS_BITMAPS | |
Indicates that the driver returns bitmaps for any glyph supported by the font. | |
FM_INFO_UNICODE_COMPLIANT | |
Indicates that a font is compliant with the Unicode standard. | |
FM_INFO_RIGHT_HANDED | |
Indicates that the ascent direction of the font is 90 degrees counterclockwise from the baseline direction. The ascent direction is the direction along which height is measured and is always perpendicular to the baseline direction. | |
FM_INFO_INTEGRAL_SCALING | |
Indicates that the font can be scaled by an integral amount in both the x and y directions. If this flag is set, then the driver must be able to render glyphs in the case where the notional to device transformation is scaled by integral amounts in the x and y directions. GDI requests the integral scaling of a font by including the axial scalings in the notional to device transformation passed to the Driver when creating the font. This flag is meaningful only when the FM_INFO_ARB_XFORMS flag has not been set. | |
FM_INFO_90_DEGREE_ROTATIONS | |
Indicates that the font can be realized in 90 degree rotations of the original notional shape. GDI requests the rotation of a font by including the rotation in the notional to device transformation passed to the driver when creating the font. This member has meaning only when the FM_INFO_ARB_XFORMS flag has not been set. | |
FM_INFO_OPTICALLY_FIXED_PITCH | |
Indicates that this font is considered typographically as fixed pitch. This is an optical quality of the font and does not necessarily indicate that all the glyphs of the font have the same character increment. | |
FM_INFO_DO_NOT_ENUMERATE | |
Indicates that this font will not be enumerated by either EnumFontFamilies or EnumFonts. Moreover, under GetTextFace, the string returned to the application will be retrieved from the string dpwszUniqueName. This flag allows the font provider to associate more than one IFIMETRICS structure with one of its fonts. | |
FM_INFO_ISOTROPIC_SCALING_ONLY | |
Indicates that the font supports arbitrary isotropic scaling only. That is, transforms are equivalent to the identity matrix multiplied by a positive real number. If this flag is set, then neither the FM_INFO_ARB_XFORMS nor the FM_INFO_ANISOTROPIC_SCALING_ONLY flags can be set. If the FM_INFO_90DEGREE_ROTATIONS flag is set, the font supports transformations equivalent to an isotropic scaling followed by a rotation by a multiple of 90 degrees. | |
FM_INFO_ANISOTROPIC_SCALING_ONLY | |
Indicates that the font supports only arbitrary anisotropic scaling. That is, transforms are equivalent to a diagonal matrix multiplied by a positive real number. If this flag is set, then the FM_INFO_ARB_XFORMS and the FM_INFO_ISOTROPIC_SCALING_ONLY flags cannot be set. If the FM_INFO_90DEGREE_ROTATIONS flag is also set, the font supports transformations that are a combination of a simple anisotropic scaling followed by a rotation by a multiple of 90 degrees. | |
FM_INFO_TID_EMBEDDED | |
This flag is used for font embedding; it is TrueType specific and should be set to zero for all other font providers. | |
FM_INFO_FAMILY_EQUIV | |
Indicates that the dpwszFamilyName offset in IFIMETRICS is actually the offset to a list of equivalent family names or aliases. The first name is the base or real name; the subsequent names are equivalents or aliases. Each name in the list is zero-terminated; the list is terminated by two zeros.
<base name> <0> <alias 1> <0>...<alias n> The based names are used only for mapping; they are not enumerated. | |
FM_INFO_DBCS_FIXED_PITCH | |
Indicates that double-byte characters for this font are fixed pitch. Nothing is implied about single byte characters. This flag is meaningful only for fonts that support a double-byte character set (DBCS), such as shift JIS. Fonts that do not support a DBCS should not set this flag. | |
FM_INFO_NONNEGATIVE_AC | |
Indicates that all glyphs of this font have nonnegative a and c spacing. That is, the glyph black box never extends outside the region bordered by the character origin and the character concatenation point. | |
FM_INFO_IGNORE_TC_RA_ABLE | |
Indicates that, for this font, the TC_RA_ABLE flag is ignored. |
Value |
Meaning |
FM_SEL_ITALIC |
Set if the characters of the font are italic. |
FM_SEL_UNDERSCORE |
Set if all the characters of the font are underscored by default; otherwise underscoring must be simulated. |
FM_SEL_NEGATIVE |
Set if the characters of the font have the foreground and background reversed. |
FM_SEL_OUTLINED |
Set if the characters of the font are hollow. |
FM_SEL_STRIKEOUT |
Set if the characters of the font are struck out by default; otherwise strikeouts must be simulated. |
FM_SEL_BOLD |
Set if the characters of the font are bold. |
FM_SEL_REGULAR |
Set if the characters of the font are normal weight. |
Value |
Meaning |
FM_TYPE_LICENSED |
Set if the font is a Restricted License font. When only this bit is set, this font must not be modified, embedded, or exchanged in any manner without first obtaining permission of the legal owner. For Restricted License embedding to take effect, it must be the only level of embedding selected. |
FM_READONLY_EMBED |
Set if read-write embedding is not permitted; only “preview and print” encapsulation is allowed. When this bit is set, the font can be embedded and temporarily loaded on the remote system. Documents containing “preview and print” fonts must be opened “read-only;” no edits can be applied to the document. |
FM_EDITABLE_EMBED |
Set if the font can be embedded and temporarily loaded on other systems. Documents containing Editable fonts can be opened for reading and writing. |
Fonts with the FM_READONLY_EMBED bit set indicate that they can be embedded within documents but must only be installed temporarily on the remote system. Any document that includes an FM_READONLY_EMBED font must be opened “read-only.” That is, the application can let the user view and/or print the document, but not edit it.
Fonts with the FM_EDITABLE_EMBED bit set indicate that they can be embedded in documents, but must only be installed temporarily on the remote system. In contrast to FM_READONLY_EMBED fonts, documents containing Editable fonts can be opened “read-write;” editing is permitted, and changes can be saved.
Fonts with no fsType bits set indicate that they can 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.
Applications that implement support for font embedding, either through use of the Font Embedding DLL or through other means, must not embed fonts that are not licensed to permit embedding. Further, applications loading embedded fonts for temporary use must delete the fonts when the document containing the embedded font is closed.
If multiple embedding bits are set, the least restrictive license
granted takes precedence. For example, if bits 1 and 3 are set, bit 3 takes
precedence over bit 1and the font can be embedded with Editable rights. For
compatibility purposes, most vendors granting Editable embedding rights also
set the Preview & Print bit (0x000C). This permits an application that
only supports Preview & Print embedding to detect that font embedding is
allowed.
The IFIMETRICS structure defines all the information per typeface that GDI understands. Most of the members are FWORD values, which are signed 16-bit quantities in design space. If the font is a raster font, design space and device space are the same and a font unit is equivalent to the distance between pixels.
The coordinate system in the font/notional space is such that the y coordinate increases in an upward direction and the x coordinate increases to the right.