Aztec® Programming Language
Version 1.1 Alpha 2

Copyright © 2010-2017, Aztec Development Group, All Rights Reserved

Download Aztec

Search        Contact Us

Well I came to the city...
I was running from the past.
My heart was bleeding...
And it hurt my bones to laugh.

- Mike Mattison and Derek Trucks

 

aztec.ui.Font

public class Font from<Base>

Base

Font

The Font class represents a text font which can be used to draw text. The font can be attached to any window to specify the appearance of text within that window. The name of the font and the point size (8, 10, 12, etc.) is used when creating the font. The class also provides an IsValid() method to indicate whether the font name and point size were valid when creating the font.

 

Note that a Font object uses UI system resources which are limited by the OS. It works most efficiently when allocated once and then used each time a window needs to be redrawn. If used in a Canvas control, allocating a new Font object every time a window has to be redrawn could eventually cause UI resources to run out.

 

The Font object also registers a font resource with the Display with which it will be used (which is passed into the constructor). If the Font is used to write or draw on a Display other than the one for which it was created, a DisplayException will be fired.

Font Methods

Font() Constructor for the Font class using a font name and point size
IsValid() Returns true if the Font object is valid
Display() Reference to Display object where Font was created

Derived Classes

See Also

 


Font()

public method Font(string FontName, int PointSize, Display Target = null)

Parameters

FontName

Name of font (e.g. "courier")

PointSize

Point size for specified font

Target

Display object where font is created and used

Return Value

None

Description

Constructor for the Font class. The font is based on the name and the point size passed in. This Font object can then be attached to any window to control the appearance of text drawn in that window. The local display is used if Target is null.

 

Font Class


IsValid()

public method<bool> IsValid()

Parameters

None

Return Value

Returns true if the font object is valid

Description

This method returns true if the font is valid (based on the specified font name and size).

 

Font Class


Display()

public method<Display> Display()

Parameters

None

Return Value

Returns reference to Display object

Description

This method returns the reference to the Display object where the Font was created (the Display that was passed into the constructor). If a null was passed into the constructor, the local display is used, and this method returns the reference to the local Display object.

 

A Font resource is created within the context of a Display, and it can only be used with that Display. If a Font is used with a Display where it was not created, a DisplayException will be fired.

 

Font Class

 

Copyright © 2010-2017

Aztec Development Group

All Rights Reserved

Download Aztec