The IFIMETRICS structure defines information for a given typeface that GDI can use.
typedef struct _IFIMETRICS {
ULONG cjThis;
ULONG cjIfiExtra;
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;
#if defined(_WIN64)
PVOID Align;
#endif
} IFIMETRICS, *PIFIMETRICS;
Note that if a font is italic by design, the driver should not indicate font support for italic simulation although it can indicate font support for bold italic simulation. Similarly, the driver should not indicate font support for bold simulation if the font is bold by design, but can indicate font support for bold italic simulation. If the font is both bold and italic by design, it should not support any simulations.
The offsets in the FONTSIM structure are relative to the base of the FONTSIM structure.
If this font does not support more than one Windows character set, dpCharSets should be set to zero.
| Value | Meaning |
|---|---|
| ANSI_CHARSET | This font supports the Windows ANSI character set. |
| ARABIC_CHARSET | This font supports the Arabic character set. |
| BALTIC_CHARSET | This font supports the Baltic character set. |
| CHINESEBIG5_CHARSET | This font supports the traditional Chinese (Big 5) character set. |
| EASTEUROPE_CHARSET | This font supports the Eastern European character set. |
| GB2312_CHARSET | This font supports the simplified (PRC) Chinese character set. |
| GREEK_CHARSET | This font supports the Greek character set. |
| HANGEUL_CHARSET | This font supports the Korean (Hangeul) character set. |
| HEBREW_CHARSET | This font supports the Hebrew character set. |
| JOHAB_CHARSET | This font supports the Korean (Johab) character set. |
| OEM_CHARSET | This font supports an OEM-specific character set. The OEM character set is system dependent. |
| SHIFTJIS_CHARSET | This font supports the Shift-JIS (Japanese Industry Standard) character set. |
| SYMBOL_CHARSET | This font supports the Windows symbol character set. |
| RUSSIAN_CHARSET | This font supports the Cyrillic character set. |
| THAI_CHARSET | This font supports the Thai character set. |
| TURKISH_CHARSET | This font supports the Turkish character set. |
| VIETNAMESE_CHARSET | This font supports the Vietnamese character set. |
| 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_1BPP | |
| Indicates that a glyph bitmap has a color depth of one bit per pixel. For Windows NT 3.1, the first version of Windows NT, this flag must be set. | |
| FM_INFO_4BPP | |
| Indicates that a glyph bitmap has a color depth of four bits per pixel. The driver should set this if the font supports antialiased glyph bitmaps with 16 levels of gray. | |
| FM_INFO_8BPP | |
| Indicates that a glyph bitmap has a color depth of eight bits per pixel. The current version of GDI will ignore this setting as it does not support color fonts. | |
| FM_INFO_16BPP | |
| Indicates that a glyph bitmap has a color depth of 16 bits per pixel. The current version of GDI will ignore this setting as it does not support color fonts. | |
| FM_INFO_24BPP | |
| Indicates that a glyph bitmap has a color depth of 24 bits per pixel. The current version of GDI will ignore this setting as it does not support color fonts. | |
| FM_INFO_32BPP | |
| Indicates that a glyph bitmap has a color depth of 32 bits per pixel. The current version of GDI will ignore this setting as it does not support color fonts. | |
| FM_INFO_90DEGREE_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_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_ARB_XFORMS | |
| Indicates that a font can be realized under a continuous range of two dimensional linear transformations. | |
| 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_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_DO_NOT_ENUMERATE | |
| Indicates that this font will not be enumerated by the Win32 EnumFontFamiliesEx, EnumFontFamilies or EnumFonts routines. Moreover, the string returned to a Win32 application call to GetTextFace 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_DSIG | |
| Indicates that a font is compliant with the Unicode standard. | |
| 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>
<0> <0>
The based names are used only for mapping; they are not enumerated. |
|
| FM_INFO_IGNORE_TC_RA_ABLE | |
| Indicates that, for this font, the TC_RA_ABLE flag is ignored. | |
| FM_INFO_INTEGER_WIDTH | |
| Indicates that all glyphs have nonfractional advance widths. Bitmap fonts usually set this flag. | |
| 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_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_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_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_NOT_CONTIGUOUS | |
| Indicates that the supported character set is not contiguous. | |
| FM_INFO_RETURNS_BITMAPS | |
| Indicates that the font contains a valid digital signature. | |
| 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_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_TECH_BITMAP | |
| Indicates that the font is a bitmap font. | |
| FM_INFO_TECH_CFF | |
| Indicates that the font is a Pscript OpenType font that contains a Compact Font Format (CFF) table. | |
| FM_INFO_TECH_MM | |
| Indicates that this is a Multiple Master (MM) font. | |
| 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_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_TRUETYPE | |
| Indicates that the font is a TrueType font. | |
| FM_INFO_TECH_TYPE1 | |
| Indicates that this font is a PostScript screen font (either Type1 or OpenType PostScript). | |
| Value | Meaning |
|---|---|
| FM_SEL_BOLD | Set if the characters of the font are bold. |
| FM_SEL_ITALIC | Set if the characters of the font are italic. |
| 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_REGULAR | Set if the characters of the font are normal weight. |
| FM_SEL_STRIKEOUT | Set if the characters of the font are struck out by default; otherwise strikeouts must be simulated. |
| FM_SEL_UNDERSCORE | Set if all the characters of the font are underscored by default; otherwise underscoring must be simulated. |
| Value | Meaning |
|---|---|
| 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. |
| 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_TYPE_LICENSED FM_NO_EMBEDDING |
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. |
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.
Declared in winddi.h. Include winddi.h.
Additional information for a typeface can optionally be specified in the IFIEXTRA structure.
A driver's DrvQueryFont routine fills out and returns an IFIMETRICS structure to GDI.
The IFIMETRICS structure defines all the information for a 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.