Export (0) Print
Expand All

DrvQueryFontData function

The DrvQueryFontData function retrieves information about a realized font.

Syntax


LONG DrvQueryFontData(
  DHPDEV dhpdev,
  FONTOBJ *pfo,
  ULONG iMode,
  HGLYPH hg,
  GLYPHDATA *pgd,
  _Out_  PVOID pv,
  ULONG cjSize
);

Parameters

dhpdev

Handle to the physical device's PDEV that was returned from a prior call to DrvEnablePDEV.

pfo

Pointer to a FONTOBJ structure that defines the font realization.

iMode

Specifies the type of information requested. This parameter can be one of the following values:

ValueMeaning

QFD_GLYPHANDBITMAP

If pgd is not NULL, then the driver should fill in the GLYPHDATA structure with the metrics of the glyph specified by hg.

If pv is not NULL, a GLYPHBITS structure should be written at this address. The driver should copy the glyph bitmap corresponding to the glyph specified by hg into this structure. The size of the structure is specified by cjSize.

If glyph bitmaps are not supported by the driver, this function will only be called with pv set to NULL.

If the driver supports glyph bitmaps, the return value is the size, in bytes, of the glyph bitmap. Otherwise, it is zero.

This mode must be supported.

QFD_GLYPHANDOUTLINE

If pgd is not NULL, then the driver should fill in the GLYPHDATA structure with the metrics of the glyph specified by hg.

If pv is not NULL, a PATHOBJ structure should be written at this address. The driver passes this PATHOBJ to the PATHOBJ_Xxx services to create the outline for the glyph specified by hg. The cjSize parameter should be ignored.

The return value is zero if the function is successful. Otherwise, it is FD_ERROR.

Only font drivers that provide glyph outlines need to support this mode.

QFD_MAXEXTENTS

If pv is not NULL, the driver should write an FD_DEVICEMETRICS structure to the buffer pointed to by pv.

The return value is the size, in bytes, needed for the buffer if pv is NULL.

QFD_TT_GRAY1_BITMAP

The realized font should be rendered in one bit-per-pixel of grayscale (that is, either black or white).

QFD_TT_GRAY2_BITMAP

The realized font should be rendered in two bits-per-pixel of grayscale.

QFD_TT_GRAY4_BITMAP

The realized font should be rendered in four bits-per-pixel of grayscale.

QFD_TT_GRAY8_BITMAP

The realized font should be rendered in eight bits-per-pixel of grayscale.

QFD_TT_MONO_BITMAP

Same as QFD_TT_GRAY1_BITMAP.

 

hg

Handle to the glyph.

pgd

Pointer to GLYPHDATA structure. This parameter can be NULL.

pv [out]

Pointer to a data buffer. The type of data written to this buffer is dependent on iMode. This parameter can be NULL.

cjSize

Specifies the size of the buffer pointed to by pv.

Return value

The return value depends on the value of the iMode parameter. If an error occurs, the return value is FD_ERROR, and an error code is logged.

Remarks

For the QFD_GLYPHANDBITMAP and QFD_GLYPHANDOUTLINE values of the iMode parameter, GDI provides a pointer to a GLYPHDATA structure (in the pgd parameter). The driver places information about glyph metrics in this structure and writes the contents of either a GLYPHBITS structure or a PATHOBJ structure in the location specified by the pv parameter, depending respectively, on whether the font is a bitmap font or an outline font. For the QFD_MAXEXTENTS value of the iMode parameter, the driver writes the contents of an FD_DEVICEMETRICS structure in the location specified by the pv parameter.

DrvQueryFontData is required for font drivers and drivers that use device-specific or driver-specific fonts.

Requirements

Header

Winddi.h (include Winddi.h)

See also

DrvEnablePDEV
DrvQueryFontFile
GLYPHDATA
FD_DEVICEMETRICS
FONTOBJ
GLYPHBITS
PATHOBJ

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft