Click or drag to resize

Font Class (Typed)

X#
Create a font, which describes how characters are displayed on a window.
Inheritance Hierarchy
Object
  VObject
    Font

Namespace:  XSharp.VO.SDK
Assembly:  XSharp.VOGUIClasses (in XSharp.VOGUIClasses.dll) Version: 2.19
Syntax
 CLASS Font INHERIT VObject
Request Example View Source

The Font type exposes the following members.

Constructors
  NameDescription
Public methodFont
Construct a font.
Top
Properties
  NameDescription
Public propertyBold
A logical value determining whether a font is displayed in a bold typeface (TRUE if yes; otherwise, FALSE).
Public propertyFamily
Public propertyItalic
A logical value determining whether a font is displayed in a italic typeface (TRUE if yes; otherwise, FALSE).
Public propertyLight
A logical value determining whether a font is displayed in a light typeface (TRUE if yes; otherwise, FALSE). Light is the opposite of bold.
Public propertyNormal
A logical value determining whether a font is displayed in a normal typeface (TRUE if yes; otherwise, FALSE).
Public propertyPitchFixed
A logical value determining whether a font is displayed in a fixed pitch typeface (TRUE if yes; otherwise, FALSE).
Public propertyPitchVariable
A logical value determining whether a font is displayed in a variable pitch typeface (TRUE if yes; otherwise, FALSE).
Public propertyStrikethru
A logical value determining whether a font is displayed in a strikethrough typeface (TRUE if yes; otherwise, FALSE). A strikethough typeface places a line through every character.
Public propertyUnderline
A logical value determining whether a font is displayed in an underline typeface (TRUE if yes; otherwise, FALSE).
Public propertyWeight
Public propertyWidth
Top
Functions
  NameDescription
Public methodStatic memberConvertFont
Public methodConvPntToDim
Convert a specified point size for the font into a Dimension object.
Public methodDestroy
Provide a method to de-instantiate a Font object.
(Overrides Destroy.)
Public methodStatic memberGetStdFontScreenHeight
Public methodHandle
Return the handle for a font.
Top
Operators
Globals and Defines
  NameDescription
Public fieldoCargo
Cargo slot.
(Inherited from VObject.)
Top
Remarks
X# provides a set of predefined fonts, defined with the Font:Init() method. In addition, if desired, you can also create a font by specifying a particular size and style.) Although you supply specifics for a new font, the GUI actually picks an actual font which best fits the description provided. Each window has a currently selected font. Window:TextPrint() and Window:SizeText() use this font when they are printing or sizing text.
Tip Tip
Deselecting a Font: In Windows, the current font should be deselected before destroying the window. To do this, use Window:Font to assign the previous font, for example. However, this is only necessary if there is a font other than the default one currently selected. Font Pitch: A font's pitch can be either variable or fixed. In variable pitch fonts, characters are proportionally spaced (for example, a variable pitch font uses more space to print an "M" than an "i"). In fixed pitch fonts, the same amount of space is used by each character, regardless of the character width. Fixed pitch fonts are most commonly used by terminals and typewriters or to display program text. Variable pitched fonts are not always supported. This is dependent on the individual font.
Examples
The following text illustrates how to write some text in italics:
X#
1...
2oMyFont := Font{FONTROMAN10}
3oMyFont:Italic := TRUE
4oOldFont := oMyWindow:Font
5oMyWindow:Font := oMyFont
6oMyWindow:TextPrint("Italic text",Point{10,10})
7oMyWindow:Font := oOldFont
See Also