Text Widget

From Tombstone Engine Wiki
Jump to: navigation, search

The Text Widget displays a plain text string. Other widgets that display text, such as a check box, are derived from the Text Widget and possess all of the same capabilities.

In the Panel Editor, the text string box contains the string that is displayed by the widget. If the text is displayed as multiple lines (because Box mode is set to Wrap text), then a hard line break can be inserted by entering \n in the text string. Formatting directives may also be embedded inside the text string. See Text Formatting for details.

The Widget color setting controls the color of the text.

Settings

The following settings are available specifically for Text Widgets.

Setting

Description

Text Settings

Font

Determines in what font the text is displayed.

Font size

Specifies the size of the font. This corresponds to the height of the em square for the font, in pixels. The heights of capital letters in a font are typically about 70% of this size, but this can vary significantly from one font to another.

Text scale

Specifies a scale to be applied to the text. The font size is multiplied by the text scale to calculate the final size at which text is rendered.

Alignment

Determines the alignment of the text within the widget's bounding box. This can be Left, Center, or Right.

Box mode

Determines what action is taken when the text does not fit within the horizontal bounds of the widget. If this is set to Clip text, then text that flows beyond the left or right edge of the widget's bounding box is clipped. If this is set to Wrap text, then the text is displayed as multiple lines that are broken after spaces or hyphens. If this set to Overflow, then text that flows beyond the left or right edge is rendered outside the bounding box without clipping.

Layout Settings

Leading (em)

Specifies the vertical distance between two consecutive baselines in multi-line text, in em units. The default value of 1.2 em produces a typical line spacing.

Tracking (em)

Specifies additional horizontal space that is inserted between all characters, in em units.

Enable kerning

Determines whether kerning is applied to the text. When this is enabled, information taken from tables in the original font are used to adjust the spacing between certain pairs of characters to improve visual appearance.

Enable join sequences

Determines whether join sequences are generally applied to the text. The specific types of sequence substitutions are individually enabled by the following settings.

• Glyph composition

If join sequences are enabled, determines whether glyph composition is applied to the text. This allows the use of skin tone modifiers, family emoticons, and national flags when these are included in a font.

• Standard ligatures

If join sequences are enabled, determines whether standard ligatures are rendered in place of certain character sequences. Standard ligatures typically include things like the single glyph "fi" being rendered in place of the two letters "f" and "i", but some fonts consider these to be discretionary.

• Required ligatures

If join sequences are enabled, determines whether ligatures required by certain writing systems are rendered in place of certain character sequences.

• Discretionary ligatures

If join sequences are enabled, determines whether discretionary ligatures are rendered in place of certain character sequences. This is disabled by default.

Enable combining marks

Determines whether Unicode combining marks are positioned upon the preceding base character using information contained in the original font.

Glyph Effect Settings

Glyph effect

Determines what special effect is applied to the text. If this is set to None, then no effect is applied, and the following glyph effect parameters are ignored.

If this is set to Shadow, then a drop shadow is rendered behind the text with the intensity, size, and offset specified by the following settings. If this is set to Glow, then a glow effect is rendered in front of the text with the intensity, size, and offset specified by the following settings.

Glyph effect intensity

Specifies the intensity of each glyph effect. This corresponds to the opacity of the shadow effect or the maximum brightness of the glow effect.

Glyph effect size (em)

Specifies the size of each glyph effect, in em units. This value is clamped to the maximum value specified for the font when it was imported.

Glyph effect offset X (em)

Specifies the offset of the shadow effect in the x direction, in em units. This value is clamped to the minimum and maximum values specified for the font when it was imported.

Glyph effect offset Y (em)

Specifies the offset of the shadow effect in the y direction, in em units. This value is clamped to the minimum and maximum values specified for the font when it was imported.

Font Rendering Settings

Enable supersampling

Specifies whether supersampling is applied to the rendered glyphs. This is enabled by default for standalone panel resources, and it is disabled by default for in-game panel effects. Supersampling should be enabled for text that will usually be rendered at small sizes, but because it has a significant performance cost, it should be disabled for text that will often be rendered at large sizes where it has a less noticeable effect.

Render multicolor glyphs

Specifies whether multicolor glyphs are rendered if they are available in the font.

Optimize for large size

Specifies whether geometry and band-split optimizations are applied to rendered glyphs. These have no effect on the visual appearance of the text, but they can increase performance for text rendered at large sizes. These can have a negative effect on performance when text is rendered at small sizes, so they should not be enabled in those cases.

See Also