Click or drag to resize

Font Constructor

X#
Construct a font.

Namespace:  VO
Assembly:  VOGUIClasses (in VOGUIClasses.dll) Version: 2.21
Syntax
 CONSTRUCTOR(
	kFont,
	oDimension,
	sTypeFace
) CLIPPER
Request Example View Source

Parameters

kFont (Optional)
Type: Usual
The standard font to be created, specified as one of the constants in the table in the remarks section or the constant that indicates the font family. Specify one of the following constants:
oDimension (Optional)
Type: Usual
The dimension of the font in canvas coordinates or the windows point size for the font.
sTypeFace (Optional)
Type: Usual
The specific font name.
Remarks
kStandardFontPoint Size/Font
FONTMODERN88 point Courier
FONTMODERN1010 point Courier
FONTMODERN1212 point Courier
FONTROMAN88 point Times Roman
FONTROMAN1010 point Times Roman
FONTROMAN1212 point Times Roman
FONTROMAN1414 point Times Roman
FONTROMAN1818 point Times Roman
FONTROMAN2424 point Times Roman
FONTSWISS88 point Helvetica
FONTSWISS1010 point Helvetica
FONTSWISS1212 point Helvetica
FONTSWISS1414 point Helvetica
FONTSWISS1818 point Helvetica
FONTSWISS2424 point Helvetica
FONTSYSTEM88 point default system font
kFamiliyFont Family
FONTANYAny displayable font. This is the default.
FONTDECORATIVEA system-dependent decorative font, e.g. FormalScrp421 BT.
FONTMODERNSimilar to Courier.
FONTROMANSimilar to Times Roman
FONTSCRIPTSimilar to script handwriting,e.g. BrushScript
FONTSWISSSimilar to Helvetica.
Defining what font you want is potentially complicated, for two reasons: different computers may have different sets of fonts installed and the same font may have different names on different computers. For example, the Helvetica font family which looks like this: Helvetica, is known as Helv, Helvetica, Arial, Swiss or MS Sans Serif, depending on what system you are using. The standard name for this font here is FontSwiss. To ensure that a program will work, regardless of what fonts are available on each computer, the Font class provides automatic methods for finding a reasonable match to the font you specify. In practice, however, as long as you use the most common names you will not have a problem since all versions of Windows contain the standard fonts. For example, to create a font of 10 pt Times New Roman and one of 8 pt Helvetica:
X#
1oFontRoman := Font{FONTROMAN10}    // 
2oFontSwiss := Font{FONTSWISS8}        
The system allows you to reference any font installed on the machine. For example, to create a font of 12 pt Palatino,
X#
1oMyFont := Font{,Dimension{12,12},"Palatino"}    
Or a font of 16 pt Arial:
X#
1oMyFont := Font{, 16, "Arial"}  
That approach, of course, is vulnerable to the font not being available. If Palatino is not available, the system would choose a reasonable facsimile, and if it had never heard of Palatino, this might not be a good match. To help the system come up with a reasonable match, you can specify what font family Palatino belongs to:
X#
1oMyFont := Font{FONTROMAN, Dimension{12,12},"Palatino"}
In this case, we would get Times Roman if Palatino was not available. You can specify the family only. For example, to create a 10 pt font in whatever is available in the script family:
X#
1oMyFont := Font{FONTSCRIPT,Dimension{10,10}}
See Also