GR_LOGFONT

Name

GR_LOGFONT -- Font properties

Synopsis

typedef struct 
{
    long     lfHeight;
    long     lfWidth;
    long     lfEscapement;
    long     lfOrientation;
    long     lfWeight;
    GR_CHAR  lfItalic;
    GR_CHAR  lfUnderline;
    GR_CHAR  lfStrikeOut;
    GR_CHAR  lfCharSet;
    GR_CHAR  lfOutPrecision;
    GR_CHAR  lfClipPrecision;
    GR_CHAR  lfQuality;
    GR_CHAR  lfRoman;
    GR_CHAR  lfSerif;
    GR_CHAR  lfSansSerif;
    GR_CHAR  lfModern;
    GR_CHAR  lfMonospace;
    GR_CHAR  lfProportional;
    GR_CHAR  lfOblique;
    GR_CHAR  lfSmallCaps;
    GR_CHAR  lfPitch;
    char     lfFaceName[MWLF_FACESIZE];
} GR_LOGFONT;
  

Description

A GR_LOGFONT structure is a logical font descriptor it is used to specify the desired font characteristics when creating a font. An application passes one of these structures into the GrCreateFont() function when a font is created.

Several macros are defined in mwtypes.h to help build the GR_LOGFONT structure. These macros are shown below.

Fields

TypeNameDescription
longlfHeightThe font height in pixels.
longlfWidthThe font width in pixels.
longlfEscapementThe rotation of the font in tenths of a degree.
longlfOrientationThis field is not currently used.
longlfWeightThe font weight. See below
GR_CHARlfItalicGR_TRUE for an italic font, otherwise GR_FALSE.
GR_CHARlfUnderlineGR_TRUE for an underlined font, otherwise GR_FALSE.
GR_CHARlfStrikeOutThis field is currently not used.
GR_CHARlfCharSetThe font character set. See below
GR_CHARlfOutPrecisionFont type selection. See below
GR_CHARlfClipPrecisionThis field is currently not used.
GR_CHARlfQualityThis field is currently not used.
GR_CHARlfRomanGR_TRUE for Roman (upright) letters, otherwise GR_FALSE.
GR_CHARlfSerifGR_TRUE for a serifed font, otherwise GR_FALSE.
GR_CHARlfSansSerifGR_TRUE for a sans-serif font, otherwise GR_FALSE.
GR_CHARlfModernGR_TRUE for a modern font, otherwise GR_FALSE.
GR_CHARlfMonospaceGR_TRUE for a monsspaced font, otherwise GR_FALSE.
GR_CHARlfProportionalGR_TRUE for a proportionally spaced, otherwise GR_FALSE.
GR_CHARlfObliqueGR_TRUE for an oblique font, otherwise GR_FALSE.
GR_CHARlfSmallCapsGR_TRUE for a small caps font, otherwise GR_FALSE.
GR_CHARlfPitchThe font pitch. See below
charlfFaceName[]Zero terminated ASCII string containing the font face name.

Field Enumerations

The following paragraphs list the enumeration values that may be used with the fields of the GR_LOGFONT structure.

Enumerations for the lfOutPrecision field.

MWLF_TYPE_DEFAULTMWLF_TYPE_SCALEDMWLF_TYPE_RASTER
MWLF_TYPE_TRUETYPEMWLF_TYPE_ADOBE

Enumerations for the lfWeight field.

MWLF_WEIGHT_DEFAULTMWLF_WEIGHT_MEDIUM
MWLF_WEIGHT_THINMWLF_WEIGHT_DEMIBOLD
MWLF_WEIGHT_EXTRALIGHTMWLF_WEIGHT_BOLD
MWLF_WEIGHT_LIGHTMWLF_WEIGTH_EXTRABOLD
MWLF_WEIGHT_NORMALMWLF_WEIGHT_BLACK
MWLF_WEIGHT_REGULAR

Enumerations for the lfCharSet field.

MWLF_CHARSET_ANSIMWLF_CHARSET_DEFAULT
MWLF_CHARSET_UNICODEMWLF_CHARSET_OEM

Enumerations for the lfPitch field.

MWLF_PITCH_DEFAULTMWLF_PITCH_NORMAL
MWLF_PITCH_ULTRACONDENSEDMWLF_PITCH_SEMIEXPANDED
MWLF_PITCH_EXTRACONDENSEDMWLF_PITCH_EXPANDED
MWLF_PITCH_CONDENSEDMWLF_PITCH_EXTRAEXPANDED
MWLF_PITCH_SEMICONDENSEDMWLF_PITCH_ULTRAEXPANDED

Built in font face names for the lfFaceName field.

GR_FONT_SYSTEM_VARGR_FONT_OEM_FIXED
GR_FONT_GUI_VARGR_FONT_SYSTEM_FIXED

Macros

The following macros set the

Table 3-1. GR_LOGFONT Macros

NameDescription
MWLF_Clear (GR_LOGFONT *lf)This macro sets the size fields of the structure to zero, the weight to MWLF_WEIGHT_REGULAR, all of the flags to GR_FALSE and the face name to an empty string.
MWLF_SetBold (GR_LOGFONT *lf)This macro modifies the GR_LOGFONT so that it describes a bold font. The lfWeight is set to the constant value MWLF_WEIGHT_BOLD.
MWLF_SetRegular (GR_LOGFONT *lf)This macro modifies the GR_LOGFONT so that it describes a non-bold font. The lfWeight is set to the constant value MWLF_WEIGHT_REGULAR.
MWLF_SetItalics (GR_LOGFONT *lf)This macro modifies the GR_LOGFONT so that it describes an italic font. The lfItalic is set to GR_TRUE, the lfOblique is set to GR_FALSE and the lfRoman is set to GR_FALSE.
MWLF_SetRoman (GR_LOGFONT *lf)This macro modifies the GR_LOGFONT so that it describes a roman font. The lfItalic is set to GR_FALSE, the lfOblique is set to GR_FALSE and the lfRoman is set to GR_TRUE.

See Also

GrCreateFont(), GR_FONT_INFO.