Crate zng_wgt_text

Source
Expand description

Text widgets and properties.

§Crate

This crate is part of the zng project.

Modules§

cmd
Commands that control the editable text.
icon
Glyph icon widget, properties and nodes.
node
UI nodes used for building a text widget.

Macros§

Em
A simple text run with italic font style.
Strong
A simple text run with bold font weight.

Structs§

AutoSelection
Defines when text is auto-selected on focus.
CaretStatus
Display info of edit caret position.
ChangeStopArgs
Arguments for on_change_stop.
FontFeaturesMix
m Advanced font config, features, kerning, variations and more.
FontMix
m Basic text font properties.
LangMix
m Language and text direction properties.
ParagraphMix
m Text paragraph properties.
SelectionToolbarArgs
Arguments for selection_toolbar_fn.
SelectionToolbarMix
m Selection toolbar properties.
Text
W A configured text run.
TextAlignMix
m Text align, justify.
TextDecorationMix
m Text underline, overline and strikethrough lines.
TextEditMix
m Text edit properties.
TextFillMix
m Text color properties.
TextInspectMix
m Properties that probes various state from the text widget.
TextSpacingMix
m Text spacing properties.
TextTransformMix
m Text transform properties.
TextWrapMix
m Text wrap, hyphenation.
UnderlineSkip
Represents what parts of a text the underline must skip over.

Enums§

CaretShape
Defines the position of an interactive caret in relation to the selection.
ChangeStopCause
Cause of an on_change_stop.
InteractiveCaretMode
Defines when the interactive carets are used.
LinesWrapCount
Represents the number of lines and number of wrap lines in a text.
TextOverflow
Defines how text overflow is handled by the text widgets.
UnderlinePosition
Defines what line gets traced by the text underline decoration.

Statics§

ACCEPTS_ENTER_VAR
Accepts '\n' input when editable.
ACCEPTS_TAB_VAR
Accepts '\t' input when editable.
AUTO_SELECTION_VAR
Auto selection on keyboard focus.
CARET_COLOR_VAR
Caret color, inherits from FONT_COLOR_VAR.
CHANGE_STOP_DELAY_VAR
Debounce time for change stop.
FONT_AA_VAR
Font anti-aliasing of Text! spans.
FONT_COLOR_VAR
Color of Text! glyphs that are not colored by palette.
FONT_FAMILY_VAR
Font family of Text! spans.
FONT_FEATURES_VAR
Font features of Text! spans.
FONT_PALETTE_COLORS_VAR
Overrides of specific colors in the selected colored glyph palette.
FONT_PALETTE_VAR
Color of Text! glyphs that are colored by palette, mostly Emoji.
FONT_SIZE_VAR
Font size of Text! spans.
FONT_STRETCH_VAR
Font stretch of Text! spans.
FONT_STYLE_VAR
Font style of Text! spans.
FONT_SYNTHESIS_VAR
Font synthesis of Text! spans.
FONT_VARIATIONS_VAR
Font variations of Text! spans.
FONT_WEIGHT_VAR
Font weight of Text! spans.
HYPHENS_VAR
Text hyphenation config.
HYPHEN_CHAR_VAR
Hyphen text rendered when auto-hyphenating.
IME_UNDERLINE_STYLE_VAR
Underline style for the IME preview underline.
IME_UNDERLINE_THICKNESS_VAR
Underline thickness for the IME preview underline.
INTERACTIVE_CARET_VAR
Interactive caret mode.
INTERACTIVE_CARET_VISUAL_VAR
Interactive caret visual.
JUSTIFY_MODE_VAR
Text justify mode when text align is fill.
LETTER_SPACING_VAR
Extra letter spacing of Text! spans.
LINE_BREAK_VAR
Configuration of line breaks in Chinese, Japanese, or Korean text.
LINE_HEIGHT_VAR
Text line height of Text! spans.
LINE_SPACING_VAR
Extra spacing in between lines of Text! spans.
MAX_CHARS_COUNT_VAR
Maximum number of characters that can be input.
OBSCURE_TXT_VAR
If text characters are replaced with OBSCURING_CHAR_VAR for rendering.
OBSCURING_CHAR_VAR
Replacement character used when obscuring text.
OVERLINE_COLOR_VAR
Overline color, inherits from FONT_COLOR_VAR.
OVERLINE_STYLE_VAR
Overline style.
OVERLINE_THICKNESS_VAR
Overline thickness.
PARAGRAPH_SPACING_VAR
Extra paragraph spacing of text blocks.
SELECTION_COLOR_VAR
Selection background color.
SELECTION_TOOLBAR_ANCHOR_VAR
Position the selection toolbar in relation to the bounding box of all selection rectangles.
SELECTION_TOOLBAR_FN_VAR
Selection toolbar function.
STRIKETHROUGH_COLOR_VAR
Strikethrough color, inherits from FONT_COLOR_VAR.
STRIKETHROUGH_STYLE_VAR
Strikethrough style.
STRIKETHROUGH_THICKNESS_VAR
Strikethrough thickness.
TAB_LENGTH_VAR
Length of the TAB space.
TEXT_ALIGN_VAR
Text alignment inside the available space.
TEXT_EDITABLE_VAR
Text is editable.
TEXT_OVERFLOW_ALIGN_VAR
Text alignment inside the available space when it overflows.
TEXT_OVERFLOW_VAR
Text overflow handling.
TEXT_SELECTABLE_VAR
Text is selectable.
TEXT_TRANSFORM_VAR
Text transformation function applied to Text! spans.
TEXT_WRAP_VAR
If line breaks are automatically inserted to fill the available space.
TXT_PARSE_LIVE_VAR
If text parse updated for every text change.
UNDERLINE_COLOR_VAR
Underline color, inherits from FONT_COLOR_VAR.
UNDERLINE_POSITION_VAR
Position of the underline.
UNDERLINE_SKIP_VAR
Parts of text skipped by underline.
UNDERLINE_STYLE_VAR
Underline style.
UNDERLINE_THICKNESS_VAR
Underline thickness.
WHITE_SPACE_VAR
Text white space transform of Text! spans.
WORD_BREAK_VAR
Configuration of line breaks inside words during text wrap.
WORD_SPACING_VAR
Extra word spacing of Text! spans.

Traits§

TxtParseValue
Represents a type that can be a var value, parse and display.

Functions§

accepts_enter
P If the '\n' character is inserted when enter is pressed and the text is editable.
accepts_tab
P If the '\t' character is inserted when tab is pressed and the text is editable.
auto_selection
P Auto-selection on focus when the text is selectable.
caret_color
P Defines the color of the non-interactive caret.
change_stop_delay
P Debounce time for on_change_stop.
direction
P Sets the layout direction used in the layout of the widget and descendants.
font_aa
P Configure the anti-aliasing used to render text glyphs inside the widget.
font_annotation
P Sets the font annotation alternative feature.
font_caps
P Sets the font capital variant features.
font_char_variant
P Sets the font character variant alternative feature.
font_cn_variant
P Sets the Chinese logographic set.
font_color
P Defines the color the most text glyphs are filled with.
font_common_lig
P Sets the font common ligatures features.
font_contextual_alt
P Sets the font contextual alternatives feature.
font_discretionary_lig
P Sets the font discretionary ligatures feature.
font_ea_width
P Sets the East Asian figure width.
font_family
P Font family name or list of names for texts in this widget or descendants.
font_features
P Sets font features.
font_historical_forms
P Sets the font historical forms alternative feature.
font_historical_lig
P Sets the font historical ligatures feature.
font_jp_variant
P Sets the Japanese logographic set.
font_kerning
P Sets the font kerning feature.
font_num_fraction
P Sets the font numeric fraction features.
font_num_spacing
P Sets the font numeric spacing features.
font_numeric
P Sets the font numeric variant features.
font_ornaments
P Sets the font ornaments alternative feature.
font_palette
P Defines the palette used to render colored glyphs (Emoji).
font_palette_colors
P Defines custom palette colors that affect Emoji colors.
font_position
P Sets the font sub/super script position alternative feature.
font_size
P Sets the font size for the widget and descendants.
font_stretch
P Defines how condensed or expanded the preferred font should be.
font_style
P Defines the skew style of the font glyphs.
font_style_set
P Sets the font stylistic set alternative feature.
font_stylistic
P Sets the font stylistic alternative feature.
font_swash
P Sets the font swash features.
font_synthesis
P Configure if a synthetic font is generated for fonts that do not implement bold or oblique variants.
font_variations
P Sets font variations.
font_weight
P Defines the thickness or boldness the preferred font should have.
get_caret_index
P Gets the caret char index, if the text is editable.
get_caret_status
P Gets the caret display status, if the text is editable.
get_chars_count
P Gets the number of character in the text.
get_font_use
P Gets a vector of font and ranges.
get_lines_len
P Gets the number of lines in the text, including wrap lines.
get_lines_wrap_count
P Gets the number of wrap lines per text lines.
get_overflow
P Gets the overflow text, that is a clone of the text starting from the first overflow character.
hyphen_char
P The char or small string that is rendered when text is auto-hyphenated.
hyphens
P Configure hyphenation.
ime_underline
P Style and thickness of the line drawn under the IME preview text.
interactive_caret
P Defines when the interactive carets are used.
interactive_caret_visual
P Defines custom caret visual for interactive caret.
is_line_overflown
P Gets if the text has an entire line overflown.
is_overflown
P Gets if the text is overflown.
is_parse_pending
P If text has changed but txt_parse has not tried to parse the new text yet.
justify_mode
P Config the automatic spacing inserted between words and letters when text is aligned to fill.
lang
P Sets the text language and script for the widget and descendants.
letter_spacing
P Extra spacing added in between text letters. If not set inherits the letter_spacing from the parent widget.
line_break
P Configuration of text wrapping for Chinese, Japanese, or Korean text.
line_height
P Height of each text line. If not set inherits the line_height from the parent widget.
line_spacing
P Extra spacing in-between text lines. If not set inherits the line_spacing from the parent widget.
max_chars_count
P Maximum number of characters that can be input.
obscure_txt
P If the typed text is obscured in render.
obscuring_char
P Replacement character used when obscuring text.
on_change_stop
P Called after the text changed and interaction has stopped.
overline
P Draw lines above each text line.
overline_color
P Custom overline color, if not set the font_color is used.
paragraph_spacing
P Extra spacing in-between paragraphs.
selection_color
P Sets the SELECTION_COLOR_VAR.
selection_toolbar
P Defines the floating mini-toolbar that shows near a new text selection.
selection_toolbar_anchor
P Position the selection toolbar in relation to the bounding box of all selection rectangles.
selection_toolbar_fn
P Defines the floating mini-toolbar that shows near a new text selection.
strikethrough
P Draw lines across each text line.
strikethrough_color
P Custom strikethrough color, if not set the font_color is used.
tab_length
P Length of the TAB character space, relative to the normal space advance.
txt
c The text string.
txt_align
P Alignment of text inside available space.
txt_editable
P Enable text caret, input and makes the widget focusable.
txt_highlight
P Highlight a text range.
txt_overflow
P Defines if text overflow is truncated, with optional suffix append.
txt_overflow_align
P Alignment of text inside available space when the text overflows.
txt_parse
P Value that is parsed from the text and displayed as the text.
txt_parse_live
P If txt_parse tries to parse after any text change immediately.
txt_parse_on_stop
P Shorthand property, disables live parsing and parse on change stop.
txt_selectable
P Enable text selection, copy and makes the widget focusable.
txt_transform
P Text transform, character replacement applied to the text before it is processed by the text widget.
txt_wrap
P Enables or disables text wrap.
underline
P Draw lines under each text line.
underline_color
P Custom underline color, if not set the font_color is used.
underline_position
P Defines what font line gets traced by the underline.
underline_skip
P Defines what segments of each text line are skipped when tracing the underline.
white_space
P Text white space transform.
with_font_feature
Include the font feature config in the widget context.
with_font_palette_color
Set the palette color in the font palette colors.
with_font_variation
Includes the font variation config in the widget context.
word_break
P Configure line breaks inside words during text wrap.
word_spacing
P Extra spacing added to the Unicode U+0020 SPACE character. If not set inherits the word_spacing from the parent widget.