Font Constructor (Typed) | |
Construct a font.
Namespace:
XSharp.VO.SDK
Assembly:
XSharp.VOGUIClasses (in XSharp.VOGUIClasses.dll) Version: 2.21
Syntax CONSTRUCTOR(
kFont,
oDimension,
sTypeFace
) CLIPPER
[ClipperCallingConventionAttribute(new string[] { ... })]
public Font(
Usual kFont = default,
Usual oDimension = default,
Usual sTypeFace = default
)
Request Example
View SourceParameters
- 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 kStandardFont | Point Size/Font |
---|
FONTMODERN8 | 8 point Courier |
FONTMODERN10 | 10 point Courier |
FONTMODERN12 | 12 point Courier |
FONTROMAN8 | 8 point Times Roman |
FONTROMAN10 | 10 point Times Roman |
FONTROMAN12 | 12 point Times Roman |
FONTROMAN14 | 14 point Times Roman |
FONTROMAN18 | 18 point Times Roman |
FONTROMAN24 | 24 point Times Roman |
FONTSWISS8 | 8 point Helvetica |
FONTSWISS10 | 10 point Helvetica |
FONTSWISS12 | 12 point Helvetica |
FONTSWISS14 | 14 point Helvetica |
FONTSWISS18 | 18 point Helvetica |
FONTSWISS24 | 24 point Helvetica |
FONTSYSTEM8 | 8 point default system font |
| |
kFamiliy | Font Family |
---|
FONTANY | Any displayable font. This is the default. |
FONTDECORATIVE | A system-dependent decorative font, e.g. FormalScrp421 BT. |
FONTMODERN | Similar to Courier. |
FONTROMAN | Similar to Times Roman |
FONTSCRIPT | Similar to script handwriting,e.g. BrushScript |
FONTSWISS | Similar 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:
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,
1oMyFont := Font{,Dimension{12,12},"Palatino"}
Or a font of 16 pt Arial:
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:
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:
1oMyFont := Font{FONTSCRIPT,Dimension{10,10}}
See Also