class font

superclass(es) object
subclass(es) -
description The font class can be used for selecting or changing the properties of a font for a window or for drawing text with a canvas instance.
see also control - canvas

tasks

With the font class the properties of a font can be retrieved or changed, these properties include the height of the font (in pixels), how characters are displayed (bold, italic, underlined, strikout), the name of the font (for instance: Arial, Times New Roman) and the color of the characters.
The method executeDialog/2 displays the standard dialog "Font", with this dialog window the user can set all the properties of a font. If the "OK" button is pressed all the selected properties are automatically assigned to the font instance that called the method executeDialog/2. If the "Cancel" button is pressed the properties of the font instance are not changed.

The font of a control can be changed by calling the method putFont/1 of the class control.

methods

putHeight(Pixels)

func Set the height of the font, the height is specified in pixels.
pre The Pixels variable must contain an integer value.
post The height of the font was set to the value of the variable Pixels.

height(Output)

func Get the height of the font.
pre TRUE.
post The height of the font was assigned to the variable Output.

putBold(YesNo)

func Set or remove the bold property of the font.
pre The variable YesNo must contain true or false.
post If the variable YesNo contained true the bold property was set else it was removed.

bold(Output)

func Determine if the bold property of the font is set or not.
pre TRUE.
post If the bold property is set then true was assigned to the variable Output, else false was assigned.

putItalic(YesNo)

func Set or remove the italic property of the font.
pre The variable YesNo must contain true or false.
post If the variable YesNo contained true the italic property was set else it was removed.

italic(Output)

func Determine if the italic property of the font is set or not.
pre TRUE.
post If the italic property is set then true was assigned to the variable Output, else false was assigned.

putStrikeout(YesNo)

func Set or remove the strikeout property of the font.
pre The variable YesNo must contain true or false.
post If the variable YesNo contained true the strikeout property was set else it was removed.

strikeout(Output)

func Determine if the strikeout property of the font is set or not.
pre TRUE.
post If the strikeout property is set then true was assigned to the variable Output, else false was assigned.

putUnderline(YesNo)

func Set or remove the underline property of the font.
pre The variable YesNo must contain true or false.
post If the variable YesNo contained true the underline property was set else it was removed.

underline(Output)

func Determine if the underline property of the font is set or not.
pre TRUE.
post If the underline property is set then true was assigned to the variable Output, else false was assigned.

putName(Name)

func Set the name of the font.
pre The variable Name must contain a string value.
post The name of the font was set to the value of the variable of Name.

name(Output)

func Get the name of the font.
pre TRUE.
post The name of the font was assigned to Output.

putColor(R, G, B)

func Set the color of the font, the variables R(ed), G(reen) and B(lue) determine the color of the font.
pre The variables R, G and B must contain integer values which must be in the range [0, 255].
post The color of the font was changed to the color specified by the values of the variables.

color(R, G, B)

func Get the color of the font.
pre TRUE.
post The R(ed), G(reen) and B(lue) values of the color of the font were assigned to R, G and B.

executeDialog(Parent, Output)

func Display the standard dialog window "Font" and if the dialog is closed by pressing on the "OK" button the values choosen are assigned to the font instance.
pre The variable Parent must refer to a parent window.
post If the "OK" button was pressed then true was assigned to Output, else false was assigned to Output.