LOGFONT Structure

Type LOGFONT
	lfHeight As Long
	lfWidth As Long
	lfEscapement As Long
	lfOrientation As Long
	lfWeight As Long
	lfItalic As Byte
	lfUnderline As Byte
	lfStrikeOut As Byte
	lfCharSet As Byte
	lfOutPrecision As Byte
	lfClipPrecision As Byte
	lfQuality As Byte
	lfPitchAndFamily As Byte
	lfFaceName As String * 32
End Type

Description & Usage

The LOGFONT structure holds information about a logical font. The various members of the structure specify properties of the logical font.

Visual Basic-Specific Issues

None.

Data Members

lfHeight
The height of the font's character cell, in logical units (also known as the em height). If positive, the font mapper converts this value directly into device units and matches it with the cell height of the possible fonts. If 0, the font mapper uses a default character height. If negative, the font mapper converts the absolute value into device units and matches it with the character height of the possible fonts.
lfWidth
The average width of the font's characters. If 0, the font mapper tries to determine the best value.
lfEscapement
The angle between the font's baseline and escapement vectors, in units of 1/10 degrees. Windows 95, 98: This must be equal to lfOrientation.
lfOrientation
The angle between the font's baseline and the device's x-axis, in units of 1/10 degrees. Windows 95, 98: This must be equal to lfEscapement.
lfWeight
One of the following flags specifying the boldness (weight) of the font:
FW_DONTCARE
Default weight.
FW_THIN
Thin weight.
FW_EXTRALIGHT
Extra-light weight.
FW_ULTRALIGHT
Same as FW_EXTRALIGHT.
FW_LIGHT
Light weight.
FW_NORMAL
Normal weight.
FW_REGULAR
Same as FW_NORMAL.
FW_MEDIUM
Medium weight.
FW_SEMIBOLD
Semi-bold weight.
FW_DEMIBOLD
Same As FW_SEMIBOLD.
FW_BOLD
Bold weight.
FW_EXTRABOLD
Extra-bold weight.
FW_ULTRABOLD
Same as FW_EXTRABOLD.
FW_HEAVY
Heavy weight.
FW_BLACK
Same as FW_HEAVY.
lfItalic
A non-zero value if the font is italicized, 0 if not.
lfUnderline
A non-zero value if the font is underlined, 0 if not.
lfStrikeOut
A non-zero value if the font is striked out, 0 if not.
lfCharSet
Exactly one of the following flags specifying the character set of the font:
ANSI_CHARSET
ANSI character set.
ARABIC_CHARSET
Windows NT, 2000: Arabic character set.
BALTIC_CHARSET
Windows 95, 98: Baltic character set.
CHINESEBIG5_CHARSET
Chinese Big 5 character set.
DEFAULT_CHARSET
Default character set.
EASTEUROPE_CHARSET
Windows 95, 98: Eastern European character set.
GB2312_CHARSET
GB2312 character set.
GREEK_CHARSET
Windows 95, 98: Greek character set.
HANGEUL_CHARSET
HANDEUL character set.
HEBREW_CHARSET
Windows NT, 2000: Hebrew character set.
JOHAB_CHARSET
Windows 95, 98: Johab character set.
MAC_CHARSET
Windows 95, 98: Mac character set.
OEM_CHARSET
Original equipment manufacturer (OEM) character set.
RUSSIAN_CHARSET
Windows 95, 98: Russian character set.
SHIFTJIS_CHARSET
ShiftJis character set.
SYMBOL_CHARSET
Symbol character set.
THAI_CHARSET
Windows NT, 2000: Thai character set.
TURKISH_CHARSET
Windows 95, 98: Turkish character set.
lfOutPrecision
Exactly one of the following flags specifying the desired precision (closeness of the match) between the logical font ideally described by the structure and the actual logical font. This value is used by the font mapper to produce the logical font.
OUT_DEFAULT_PRECIS
The default font mapping behavior.
OUT_DEVICE_PRECIS
Choose a device font if there are multiple fonts in the system with the same name.
OUT_OUTLINE_PRECIS
Windows NT, 2000: Choose a TrueType or other outline-based font.
OUT_RASTER_PRECIS
Choose a raster font if there are multiple fonts in the system with the same name.
OUT_STRING_PRECIS
Raster font (used for enumeration only).
OUT_STROKE_PRECIS
Windows 95, 98: Vector font (used for enumeration only). Windows NT, 2000: TrueType, outline-based, or vector font (used for enumeration only).
OUT_TT_ONLY_PRECIS
Choose only a TrueType font.
OUT_TT_PRECIS
Choose a TrueType font if there are multiple fonts in the system with the same name.
lfClipPrecision
Exactly one of the following flags specifying the clipping precision to use when the font's characters must be clipped:
CLIP_DEFAULT_PRECIS
The default clipping behavior.
CLIP_EMBEDDED
This flag must be set for an embedded read-only font.
CLIP_LH_ANGLES
The direction of any rotations is determined by the coordinate system (or else all rotations are counterclockwise).
CLIP_STROKE_PRECIS
Raster, vector, or TrueType font (used for enumeration only).
lfQuality
Exactly one of the following flags specifying the output quality of the logical font as compared to the ideal font:
ANTIALIASED_QUALITY
Windows 95, 98, NT 4.0 or later, 2000: The font is always antialiased if possible.
DEFAULT_QUALITY
The default quality: the appearance of the font does not matter.
DRAFT_QUALITY
The appearance of the font is less important then in PROOF_QUALITY.
NONANTIALIASED_QUALITY
Windows 95, 98, NT 4.0 or later, 2000: The font is never antialiased.
PROOF_QUALITY
The quality of the appearance of the font is more important than exactly matching the specified font attributes.
lfPitchAndFamily
A bitwise OR combination of exactly one *_PITCH flag specifying the pitch of the font and exactly one FF_* flag specifying the font face family of the font:
DEFAULT_PITCH
The default pitch.
FIXED_PITCH
Fixed pitch.
VARIABLE_PITCH
Variable pitch.
FF_DECORATIVE
Showy, decorative font face.
FF_DONTCARE
Do not care about the font face.
FF_MODERN
Modern font face (monospaced, sans serif font).
FF_ROMAN
Roman font face (proportional-width, serif font).
FF_SCRIPT
Script font face which imitates script handwriting.
FF_SWISS
Swiss font face (proportional-width, sans serif font).
lfFaceName
The name of the font face to use. This string must be terminated with a null character.

Constant Definitions

Const FW_DONTCARE = 0
Const FW_THIN = 100
Const FW_EXTRALIGHT = 200
Const FW_ULTRALIGHT = 200
Const FW_LIGHT = 300
Const FW_NORMAL = 400
Const FW_REGULAR = 400
Const FW_MEDIUM = 500
Const FW_SEMIBOLD = 600
Const FW_DEMIBOLD = 600
Const FW_BOLD = 700
Const FW_EXTRABOLD = 800
Const FW_ULTRABOLD = 800
Const FW_HEAVY = 900
Const FW_BLACK = 900
Const ANSI_CHARSET = 0
Const ARABIC_CHARSET = 178
Const BALTIC_CHARSET = 186
Const CHINESEBIG5_CHARSET = 136
Const DEFAULT_CHARSET = 1
Const EASTEUROPE_CHARSET = 238
Const GB2312_CHARSET = 134
Const GREEK_CHARSET = 161
Const HANGEUL_CHARSET = 129
Const HEBREW_CHARSET = 177
Const JOHAB_CHARSET = 130
Const MAC_CHARSET = 77
Const OEM_CHARSET = 255
Const RUSSIAN_CHARSET = 204
Const SHIFTJIS_CHARSET = 128
Const SYMBOL_CHARSET = 2
Const THAI_CHARSET = 222
Const TURKISH_CHARSET = 162
Const OUT_DEFAULT_PRECIS = 0
Const OUT_DEVICE_PRECIS = 5
Const OUT_OUTLINE_PRECIS = 8
Const OUT_RASTER_PRECIS = 6
Const OUT_STRING_PRECIS = 1
Const OUT_STROKE_PRECIS = 3
Const OUT_TT_ONLY_PRECIS = 7
Const OUT_TT_PRECIS = 4
Const CLIP_DEFAULT_PRECIS = 0
Const CLIP_EMBEDDED = 128
Const CLIP_LH_ANGLES = 16
Const CLIP_STROKE_PRECIS = 2
Const ANTIALIASED_QUALITY = 4
Const DEFAULT_QUALITY = 0
Const DRAFT_QUALITY = 1
Const NONANTIALIASED_QUALITY = 3
Const PROOF_QUALITY = 2
Const DEFAULT_PITCH = 0
Const FIXED_PITCH = 1
Const VARIABLE_PITCH = 2
Const FF_DECORATIVE = 80
Const FF_DONTCARE = 0
Const FF_MODERN = 48
Const FF_ROMAN = 16
Const FF_SCRIPT = 64
Const FF_SWISS = 32

Used By

CHOOSEFONT_TYPE, CreateFontIndirect, EnumFontFamiliesEx, ENUMLOGFONT, ENUMLOGFONTEX, ICONMETRICS, NONCLIENTMETRICS, SystemParametersInfo

Go back to the Structure listing.
Go back to the Reference section index.


Last Modified: August 26, 2000
This page is copyright © 2000 Paul Kuliniewicz. Copyright Information Revised October 29, 2000
Go back to the Windows API Guide home page.
E-mail: vbapi@vbapi.com Send Encrypted E-Mail
This page is at http://www.vbapi.com/ref/l/logfont.html