Creates a new TextFormat instance with the given properties.
Indicates whether the text is bold. @default false
The color of the text. Note that bitmap fonts should be exported in plain white so
that tinting works correctly. If your bitmap font contains colors, set this property
to Color.WHITE
to get the desired result. @default black
The name of the font. TrueType fonts will be looked up from embedded fonts and
system fonts; bitmap fonts must be registered at the TextField class first.
Beware: If you loaded an embedded font at runtime, you must call
TextField.updateEmbeddedFonts()
for Starling to recognize it.
The horizontal alignment of the text. @default center @see starling.utils.Align
Indicates whether the text is italicized. @default false
Indicates whether kerning is enabled. Kerning adjusts the pixels between certain character pairs to improve readability. @default true
The amount of vertical space (called 'leading') between lines. @default 0
A number representing the amount of space that is uniformly distributed between all characters. @default 0
The size of the font. For bitmap fonts, use BitmapFont.NATIVE_SIZE
for
the original size.
Indicates whether the text is underlined. @default false
The vertical alignment of the text. @default center @see starling.utils.Align
Registers an event listener at a certain object.
Creates a clone of this instance.
Copies all properties from another TextFormat instance.
Dispatches an event to all objects that have registered listeners for its type. If an event with enabled 'bubble' property is dispatched to a display object, it will travel up along the line of parents, until it either hits the root object or someone stops its propagation manually.
Dispatches an event with the given parameters to all objects that have registered listeners for the given type. The method uses an internal pool of event objects to avoid allocations.
If called with one argument, figures out if there are any listeners registered for the given event type. If called with two arguments, also determines if a specific listener is registered.
Removes an event listener from the object.
Removes all event listeners with a certain type, or all of them if type is null. Be careful when removing all event listeners: you never know who else was listening.
Sets the most common properties at once.
Converts the Starling TextFormat instance to a Flash TextFormat.
Generated using TypeDoc
The TextFormat class represents character formatting information. It is used by the TextField and BitmapFont classes to characterize the way the glyphs will be rendered.
Note that not all properties are used by all font renderers: bitmap fonts ignore the "bold", "italic", and "underline" values.