Routines (alphabetical) > Object Classes > Graphics Object Classes > IDLgrFont::Init

# IDLgrFont::Init

Syntax | Return Value | Arguments | Keywords | Version History

The IDLgrFont::Init function method initializes the font object.

Note: Init methods are special lifecycle methods, and as such cannot be called outside the context of object creation. This means that in most cases, you cannot call the Init method directly. There is one exception to this rule: if you write your own subclass of this class, you can call the Init method from within the Init method of the subclass.

## Syntax

Obj = OBJ_NEW('IDLgrFont' [, Fontname] [, PROPERTY=value])

or

Result = Obj->[IDLgrFont::]Init([Fontname] [, PROPERTY=value]) (In a lifecycle method only.)

## Return Value

When this method is called indirectly, as part of the call to the OBJ_NEW function, the return value is an object reference to the newly-created object.

When called directly within a subclass Init method, the return value is 1 if initialization was successful, or zero otherwise.

## Arguments

### Fontname

A string representing the name of the font to be used. This string should take the form 'fontname*modifier1*modifier2*...*modifierN'. All destination objects support the following fontnames: Helvetica, Courier, Times, Symbol, and Monospace Symbol. (These fonts are included with IDL; you may have other fonts installed on your system as well.)

Note: The value specified by the Fontname argument is used to initialize the value of the NAME property of the IDLgrFont object.

Valid modifiers for each of these fonts (except Symbol and Monospace Symbol) are:

- Font weight: Bold
- Font angle: Italic

For example, 'Helvetica*Bold*Italic'.

To select a Hershey vector font, use a fontname of the form: `'Hershey*``fontnum``' where` `fontnum` is the Hershey font’s index number.

Note: Beginning with IDL version 5.1, only TrueType and Hershey fonts are supported in the Object Graphics system.

## Keywords

Any property listed under IDLgrFont Properties that contains the word “Yes” in the “Init” column of the properties table can be initialized during object creation using this method. To initialize the value of a property, specify the property name as a keyword set equal to the appropriate property value.

All other keywords are passed to the superclass of this object.

## Version History

5.0 | Introduced