Unlike basic text objects, a textblock handles complex text, managing multiple styles and multiline text based on HTML-like tags. However, these extra features are heavier on memory and processing cost.
The textblock objects is an object that shows big chunks of text. Textblock supports many features, including text formatting, automatic and manual text alignment, embedding items (icons, for example). Textblock has three important parts: the text paragraphs, the format nodes and the cursors.
To set markup to format text, use for example
<font_size=50>Big!</font_size>
. Set more than one style
directive in one tag with <font_size=50 color=#F00>Big and
Red!</font_size>
. Please note that we used </font_size>
although the format also included color. This is because the first format
determines the matching closing tag's name. You can use anonymous tags, such
as <font_size=30>Big</>
, which pop any type of format, but it
is advisable to use the named alternatives instead.
Textblock supports the following formats:
font
: Font description in fontconfig such as format, for example âSans:style=Italic:lang=hiâ. or âSerif:style=Boldâ.font_weight
: Overrides the weight defined in âfontâ. For example, âfont_weight=Boldâ is the same as âfont=:style=Boldâ. The supported weights are ânormalâ, âthinâ, âultralightâ, âlightâ, âbookâ, âmediumâ, âsemiboldâ, âboldâ, âultraboldâ, âblackâ, and âextrablackâ.font_style
: Overrides the style defined in âfontâ. For example, âfont_style=Italicâ is the same as âfont=:style=Italicâ. The supported styles are ânormalâ, âobliqueâ, and âitalicâ.font_width
: Overrides the width defined in âfontâ. For example, âfont_width=Condensedâ is the same as âfont=:style=Condensedâ. The supported widths are ânormalâ, âultracondensedâ, âextracondensedâ, âcondensedâ, âsemicondensedâ, âsemiexpandedâ, âexpandedâ, âextraexpandedâ, and âultraexpandedâ.lang
: Overrides the language defined in âfontâ. For example, âlang=heâ is the same as âfont=:lang=heâ.font_fallbacks
: A comma delimited list of fonts to try if finding the main font fails.font_size
: The font size in points.font_source
: The source of the font, for example an eet file.color
: The text color in one of the following formats: â#RRGGBBâ, â#RRGGBBAAâ, â#RGBâ, or â#RGBAâ.underline_color
: The color in one of the following formats: â#RRGGBBâ, â#RRGGBBAAâ, â#RGBâ, or â#RGBAâ.underline2_color
: The color in one of the following formats: â#RRGGBBâ, â#RRGGBBAAâ, â#RGBâ, or â#RGBAâ.outline_color
: The color in one of the following formats: â#RRGGBBâ, â#RRGGBBAAâ, â#RGBâ, or â#RGBAâ.shadow_color
: The color in one of the following formats: â#RRGGBBâ, â#RRGGBBAAâ, â#RGBâ, or â#RGBAâ.glow_color
: The color in one of the following formats: â#RRGGBBâ, â#RRGGBBAAâ, â#RGBâ, or â#RGBAâ.glow2_color
: The color in one of the following formats: â#RRGGBBâ, â#RRGGBBAAâ, â#RGBâ, or â#RGBAâ.strikethrough_color
: The color in one of the following formats: â#RRGGBBâ, â#RRGGBBAAâ, â#RGBâ, or â#RGBAâ.align
: The text alignment in one of the following formats: âautoâ (according to text direction), âleftâ, ârightâ, âcenterâ or âmiddleâ, which take a value between 0.0 and 1.0 or a value between 0% to 100%.valign
: The vertical text alignment in one of the following formats: âtopâ, âbottomâ, âmiddleâ, âcenterâ, âbaselineâ or âbaseâ, which take a value between 0.0 and 1.0 or a value between 0% to 100%.wrap
: The text wrap in one of the following formats: âwordâ, âcharâ, âmixedâ, or ânoneâ.left_margin
: Either âresetâ or a pixel value indicating the margin.right_margin
: Either âresetâ or a pixel value indicating the margin.underline
: The style of underlining in one of the following formats: âonâ, âoffâ, âsingleâ, or âdoubleâ.strikethrough
: The style of text that is either âonâ or âoffâ.backing_color
: The background color in one of the following formats: â#RRGGBBâ, â#RRGGBBAAâ, â#RGBâ, or â#RGBAâ.backing
: The background color enabled or disabled: âonâ or âoffâ.style
: The style of the text in one of the following formats: âoffâ, ânoneâ, âplainâ, âshadowâ, âoutlineâ, âsoft_outlineâ, âoutline_shadowâ, âoutline_soft_shadowâ, âglowâ, âfar_shadowâ, âsoft_shadowâ or âfar_soft_shadowâ. The direction is selected by adding âbottom_rightâ, âbottomâ, âbottom_leftâ, âleftâ, âtop_leftâ, âtopâ, âtop_rightâ or ârightâ. For example, âstyle=shadow,bottom_rightâ.tabstops
: The pixel value for tab width.linesize
: To force a line size in pixels.linerelsize
: Either a floating point value or a percentage indicating the wanted size of the line relative to the calculated size.linegap
: To force a line gap in pixels.linerelgap
: Either a floating point value or a percentage indicating the wanted size of the line relative to the calculated size.item
: Creates an empty space that is filled by an upper layer. Use âsizeâ, âabssizeâ, or ârelsizeâ to define the itemâs size, and an optional vsize = full/ascent to define the item's position in the line.linefill
: Either a float value or percentage indicating how much to fill the line.ellipsis
: A value between 0.0 and 1.0 to indicate the type of ellipsis, or -1.0 to indicate that an ellipsis is not wanted.password
: Either âonâ or âoffâ, this is used to specifically turn replacing chars with the password mode (that is, replacement char) on and off.