The FONTOBJ structure is used to give a driver access to information about a particular instance of a font.
typedef struct _FONTOBJ {
ULONG iUniq;
ULONG iFace;
ULONG cxMax;
FLONG flFontType;
ULONG_PTR iTTUniq;
ULONG_PTR iFile;
SIZE sizLogResPpi;
ULONG ulStyleSize;
PVOID pvConsumer;
PVOID pvProducer;
} FONTOBJ;
| Flag | Meaning |
|---|---|
| FO_CFF | Postscript OpenType font. |
| FO_DBCS_FONT | Font supports DBCS code pages. |
| FO_EM_HEIGHT | TrueType driver internal flag. |
| FO_GRAY16 | Font bitmaps are four bits-per-pixel blending (alpha) values. |
| FO_MULTIPLEMASTER | Multiple Master (Type1 or OpenType) font. |
| FO_NOGRAY16 | Indicates that the font driver cannot (or will not) grayscale a particular font realization. |
| FO_POSTSCRIPT | Postscript (Type1 or OpenType) font. |
| FO_SIM_BOLD | Driver-simulated bold font. |
| FO_SIM_ITALIC | Driver-simulated italic font. |
| FO_TYPE_DEVICE | Device-specific font. |
| FO_TYPE_OPENTYPE | OpenType™ font. |
| FO_TYPE_RASTER | Bitmap font. |
| FO_TYPE_TRUETYPE | TrueType font. |
| FO_VERT_FACE | Vertical font. |
If the FO_RASTER flag is set, the glyphs written to the specified STROBJ structure are bitmaps, otherwise they are pointers to PATHOBJ structures. If the glyph images are returned in the form of PATHOBJ structures, the driver must inspect the FM_INFO_TECH_STROKE flag of the flInfo member of the associated IFIMETRICS structure. If that flag is set, the paths should be stroked, otherwise the paths must be filled using the alternating mode convention.
If the FO_GRAY16 flag is set, then the font bitmaps are four bits-per-pixel blending (alpha) values. A value of zero means that the resulting pixel should have the same color as the background. If the alpha value is k, then the following table describes the attributes of the resulting pixel, using either linear alpha blending, or gamma-corrected alpha blending. In both methods, the foreground and background colors are, respectively, cf and cb.
| Pixel Attribute | Description |
|---|---|
| Blended Color (linear alpha blending) |
Linear alpha blending produces a blended color that is a linear combination of the foreground and background colors.
c = b * cf + (1 - b) * cb The blend fraction, b, is obtained as follows: b = k / 15, for k = 0, 1, 2, ..., 15 Note: the foreground and background colors include all three color channels (R, G, B). |
| Blended Color (gamma-corrected alpha blending) |
Gamma-corrected alpha blending produces a blended color by raising a variable that depends on the alpha value to a fixed power.
Two formulas are provided: one should be used when the foreground color is numerically larger than the background color; the other should be used in the opposite case. (When the foreground and background colors are equal, both formulas simplify to c = cb.) If cf > cb, If cf < cb, In these formulas, gamma = 2.33, and b[k] is the kth blending fraction, obtained as follows: b[k] = 0, for k = 0, and Note: unlike linear alpha blending, these formulas must be applied to each of the three color channels (R, G, B). |
GDI sets the FO_GRAY16 flag on entry to the DrvQueryFontData function when it requests that a font be grayscaled to one of 16 values. If the font driver cannot grayscale a particular font realization, then the font provider clears the FO_GRAY16 flag and sets the FO_NOGRAY16 flag to inform GDI that the grayscaling request will not be satisfied.
Declared in winddi.h. Include winddi.h.
As an accelerator, the driver is allowed to access the public members of the FONTOBJ structure.
A driver can be both a producer and a consumer. For example, a printer driver can act as a producer while processing a call to the driver-supplied DrvQueryFontData function to provide glyph metrics, and later act a consumer while processing a call to the driver-supplied DrvTextOut function.
DrvDestroyFont, DrvGetGlyphMode, DrvQueryFont, DrvQueryTrueTypeOutline, FONTOBJ_cGetAllGlyphHandles, FONTOBJ_cGetGlyphs, FONTOBJ_pifi, FONTOBJ_pxoGetXform, FONTOBJ_vGetInfo, IFIMETRICS