A wrapper for CreateFont WinAPI function. Create an instance of this class, setup some attributes, and call GetHandle. In the future this class may be extended to something less trivial.
For the meaning of properties see WinAPI documentation for CreateFont function.
Create a font with given properties. Calls WinAPI CreateFont. Rememeber to free result somewhere by DeleteObject.
Remeber that you may not get the font you asked for. Windows.CreateFont will try to return something as close as possible, but if exact match will not be possible – it can return something else. E.g. specifying FaceName = 'some non-existing font name' will not cause some error (like EOSError). Instead it will result in default Windows font ("MS Sans Serif" usually) being returned.
Exceptions raised
EOSError
If font cannot be created (when WinAPI CreateFont returned error)
constructor Create(AHeight: Integer);
Constructor, takes initial Height value. We require the height value to be passed to constructor, simply because there's no "generally sensible" default value for Height.
Font pitch and family. They will be combined to create fdwPitchAndFamily param, i.e. fdwPitchAndFamily := Pitch or Family. Pitch is for XXX_PITCH consts, Family is for FF_XXX consts.