Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

FontSpec

The FontSpec class represents a specification for a font. The constructor is accessible from scripts.

Fields

FieldTypeDescription
familystringRead only. The font family; e.g., Arial, New Times Roman, SansSerif, etc.
styleFont Style TypeRead Only. The derived style of the font, plain, bold, italic or bold/italic. Note that fonts like Arial Bold that have an inherent style have this field set to plain.
sizenumber or AUTOSIZERead Only. The point size of the font. Can be set to AUTOSIZE when the entityTitleFont field of the Document is involved.
ascentnumberRead only. The ascent of the font. If you construct a FontSpec at runtime, you must call the calcFont method in a Document instance to make this field valid.
descentnumberRead only. The descent of the font. If you construct a FontSpec at runtime, you must call the calcFont method in a Document instance to make this field valid.
uppercaseHeightnumberRead only. The maximum ascent of the letters X, O, and M of the font. If you construct a FontSpec at runtime, you must call the calcFont method in a Document instance to make this field valid.

Methods

init( family, style, size )

Creates a new FontSpec with the given family, style and size.

Constants

Font Style Type

PLAIN

Indicates a style of plain.

BOLD

Indicates a style of bold. This can be or’ed with ITALIC.

ITALIC

Indicates a style of italic. This can be or’ed with BOLD

Font Size Type

AUTOSIZE

Indicates the size should be determined algorithmically. Only used for the entityTitleFont field of Document.