OWLNext 7.0
Borland's Object Windows Library for the modern age
|
You can construct a TFont either directly, by specifying all the attributes of the font in the constructor, or indirectly, by specifying a TFont & or a pointer to a LOGFONT structure.
Directly constructing a pen creates a new object with the specified attributes. Here are the constructors for directly constructing a font:
The first constructor lets you conveniently plug in the most commonly used attributes for a font (such as name, height, width, and so on) and let the other attributes (which generally have the same value time after time) take their default values. The second constructor has the parameters in the same order as the CreateFont Windows API call so you can easily cut and paste from existing Windows code.
Indirectly creating a font also creates a new object, but it copies the attributes of the object passed to it into the new font object. Here are the constructors for indirectly creating a font:
You can also create a new TFont object from an existing HFONT handle:
This constructor is used to obtain an ObjectWindows object as an alias to a regular Windows handle received in a message.