Technical Reference > Graphics Builder Automation Interface > Text Property Functions > AttributeTextFont

AttributeTextFont

Applies a specific font to the selected text, or retrieves the font setting.

Syntax

AttributeTextFont(TextFont)

TextFont:

The font name as a string.

Return Value

If retrieving the current font, the name of the font as a string, for example "courier". If applying a particular font, 0 (zero) if successful. In both cases, an error is returned if unsuccessful. If values are out of range on writing to the attribute, the function will exit and report the error E_INVALIDARG. If there is no active text object, these functions throw an exception with a return value of E_HANDLE.

Note: For details on handling return and error values, see Error Handling.

Related Functions

AttributeText, AttributeTextStyle, AttributeTextJustification, AttributeTextFontSize, AttributeTextColour

Example

' Applies the font Courier to the selected text
GraphicsBuilder.AttributeTextFont = "Courier"

' Retrieves the font setting
MyVariable = GraphicsBuilder.AttributeTextFont

Note: This function is implemented in the C++ environment as two separate functions: put_AttributeTextFont applies a font to the currently selected text, and get_AttributeTextFont retrieves the current font setting.