LOGFONT


typedef struct {
    short lfHeight;
    short lfWidth;
    short lfEscapement;
    short lfOrientation;
    short lfWeight;
    BYTE  lfItalic;
    BYTE  lfUnderline;
    BYTE  lfStrikeOut;
    BYTE  lfCharSet;
    BYTE  lfOutPrecision;
    BYTE  lfClipPrecision;
    BYTE  lfQuality;
    BYTE  lfPitchAndFamily;
    BYTE  lfFaceName [LF_FACENAME];
} LOGFONT;

Contains the logical attributes for a font.

lfHeight

Height of the font, in device units. If this member is greater than zero, the driver should choose a font with a cell height that matches the given height. If this member is zero, the driver should choose a font having a reasonable default size. If this member is less than zero, the driver should choose a font whose character height (that is, cell height less internal leading) matches the absolute value of this member. In all cases, the driver should choose the largest font that does not exceed the requested height and, if there is no such font, choose the next smallest font available.

lfWidth

Average width of characters in the font, in device units. If this member is zero, the driver should choose an available font with a digitization aspect ratio (the dfVertRes member of the FONTINFO structure) that most closely matches the aspect ratio of the device (the dpAspectY member in the GDIINFO structure). When comparing fonts, the driver should compare the absolute values of the differences between the digitization aspect ratio and the device aspect ratio.

lfEscapement

Angle, in tenths of a degree, counterclockwise from the x-axis of the vector passing through the origin of all the characters in the string.

lfOrientation

Angle, in tenths of a degree, counterclockwise from the x-axis of the baseline of the character.

lfWeight

Weight of the font ranging from 1 to 1000, with 400 being the value for the standard font. If this member is zero, the driver should choose a reasonable weight. The following values are defined:

FW_DONTCARE (0)

FW_THIN (100)

FW_EXTRALIGHT (200)

FW_LIGHT (300)

FW_NORMAL (400)

FW_MEDIUM (500)

FW_SEMIBOLD (600)

FW_BOLD (700)

FW_EXTRABOLD (800)

FW_HEAVY (900)

lfItalic

Italic flag. If TRUE, the font is to be italic; otherwise, it is not.

lfUnderline

Underline flag. If the low bit is set, the font is to be underlined. All other bits must be zero.

lfStrikeOut

Strikeout flag. If the low bit is set, the font is to be struck out. All other bits must be zero.

lfCharSet

Character-set to be used. Can be one of these values:

ANSI_CHARSET (0)

ANSI character set.

DEFAULT_CHARSET (1)

Default character set.

SYMBOL_CHARSET (2)

Symbol character set.

OEM_CHARSET (255)

OEM-specific character set. The characters and corresponding character codes depend on the computer.


Character set values that support international versions of the operating system are also permitted. The following are defined:

MAC_CHARSET (77)

SHIFTJIS_CHARSET (128)

HANGEUL_CHARSET (129)

CHINESEBIG5_CHARSET (136)

lfOutPrecision

Required output precision for text. Can be one of these values:

OUT_DEFAULT_PRECIS (0x00)

Chooses a reasonable font.

OUT_STRING_PRECIS (0x01)

Chooses the font with a size (height and width) most closely matches the requested size. The driver may disregard the requested orientation and escapement, but other attributes must match.

OUT_CHARACTER_PRECIS (0x02)

Chooses the font with a size (height and width) most closely matches the requested size. The driver may disregard the requested orientation, but other attributes must match.

OUT_STROKE_PRECIS (0x03)

Chooses a font with attributes exactly match the requested attributes.

OUT_TT_PRECIS (0x04)

Choose a True Type font when more than one type of font with a given name exits in the system.

OUT_DEVICE_PRECIS (0x05)

Choose a device font when more than one type of font with a given name exits in the system.

OUT_RASTER_PRECIS (0x06)

Choose a raster font when more than one type of font with a given name exits in the system.

OUT_TT_ONLY_PRECIS (0x07)

Always choose a True Type font even when the given name matches a raster or vector font.


lfClipPrecision

Required clipping precision for text. Can be one of these values:

CLIP_DEFAULT_PRECIS (0x00)

Chooses a reasonable font.

CLIP_CHARACTER_PRECIS (0x01)

Chooses a font that allows clipping of individual characters. The driver must be able to clip a character if any portion of it lies outside the clipping rectangle.

CLIP_STROKE_PRECIS (0x02)

Chooses a font that allows clipping of portions of a character. The driver must be able to clip any portion of a character that lies outside the clipping rectangle.

CLIP_MASK (0x0F)

CLIP_LH_ANGLES (0x10)

If the CLIP_LH_ANGLES bit is set, rotation for all fonts depends on whether the orientation of the coordinate system is left-handed or right-handed. If CLIP_LH_ANGLES is not set, device fonts always rotate counterclockwise, but the rotation of other fonts is dependent on the orientation of the coordinate system.

CLIP_TT_ALWAYS (0x20)

CLIP_EMBEDDED (0x80)

To use an embedded read-only font, applications must specify CLIP_EMBEDDED.


lfQuality

Required quality for text. Can be one of these values:

DEFAULT_QUALITY (0x00)

Chooses a reasonable font.

DRAFT_QUALITY (0x01)

Chooses a font that generates the most efficient, speediest output. The driver can sacrifice appearance if a speedier font has lower quality. GDI synthesizes bold, italic, underline, and strikethrough characters if needed.

PROOF_QUALITY (0x02)

Chooses a font that generates the highest-quality output. The driver should sacrifice speedy output if a slower font has higher quality. The driver should sacrifice output precision if a font that does not exactly match the requested attributes (such as size) is a higher quality. GDI synthesizes bold, italic, underline, and strikeout characters if needed.


lfPitchAndFamily

Font pitch and font family. This member is a combination of one pitch and one family value. The pitch value can be one of these values:

DEFAULT_PITCH (0x00)

Chooses a reasonable font.

FIXED_PITCH (0x01)

Chooses a fixed-pitch font.

VARIABLE_PITCH (0x02)

Chooses a variable-pitch font.


Font family, which describes in a general way the look of a font. Can be one of these values:

FF_DONTCARE (0x00)

Chooses a reasonable font.

FF_ROMAN (0x10)

Chooses a variable-pitch font with serifs.

FF_SWISS (0x20)

Chooses a variable-pitch fonts without serifs.

FF_MODERN (0x30)

Chooses a fixed-pitch font.

FF_SCRIPT (0x40)

Chooses a cursive or script font.

FF_DECORATIVE (0x50)

Chooses a novelty font.


lfFaceName

Null-terminated string that specifies the name of the font. The driver should choose a font having the given name. If the string is empty (the first byte is zero), the driver should choose a reasonable font. The string, including the null terminating character, does not exceed 32 bytes (LF_FACESIZE).

See also EnumObj, GDIINFO, FONTINFO