DWORD EnumNearestFonts(hdc, pExtLogFontTarg, cbBuffer, pfmBuffer) | |||
HDC hdc; | |||
LPEXTLOGFONT pExtLogFontTarg; | |||
DWORD cbBuffer; | |||
LPFMATCH pfmBuffer; |
This function finds the weighted differences between a target font specified by the application and all the fonts available to a DC. A sorted array of FMATCH structure is returned to a buffer provided by the application.
hdc
A handle to a valid DC.
pExtLogFontTarg
Points to an EXTLOGFONT structure supplied by the application. This defines the target font. All available fonts are compared to this wish. The EXTLOGFONT structure has the following form:
typedef struct tagEXTLOGFONT {
LOGFONT elfLogFont;
BYTE elfFullName[LF_FULLFACESIZE];
BYTE elfStyle[LF_FACESIZE];
DWORD elfVersion;
DWORD elfCulture;
PANOSE elfPanose;
BYTE elfVendorId[ELF_VENDOR_SIZE];
DWORD iMatch;
} EXTLOGFONT;
cbBuffer
Specifies the size of the application's return buffer in bytes. GDI will never write beyond this limit.
pfmBuffer
Points to a buffer in memory where GDI will return an ordered array of zero terminated FMATCH structures. The closest match to the target font are placed at the lowest position in memory.
zero terminated means that the FMATCH array terminates once an FMATCH::fmSize field is found to be zero.
The FMATCH structure has the following form:
typedef struct tagFMATCH {
DWORD fmSize;
DWORD fmTotalPenalty;
FMPENALTYSET fmPenaltySet;
EXTLOGFONT fmExtLogFont;
} FMATCH;
The return value is equal to the number of matches returned. An error is indicated by a return value of -1.
FMCONTROLS GetFontMapperControls FMATCH