18.4.6 Retrieving Information About a Logical Font

An application can retrieve information about a font by specifying the font handle in a call to the GetObject function. The GetObject function copies logical-font information to a LOGFONT structure.

The following example uses the GetObject function to retrieve logical-font information for a font and then checks whether the font is italic:

LOGFONT lf;

GetObject(hfnt, sizeof(LOGFONT), &lf);
if (lf.lfItalic)
    return TRUE;
else
    return FALSE;