[][src]Module azul_text_layout::text_layout

Contains functions for breaking a string into words, calculate the positions of words / lines and do glyph positioning

Structs

ClusterInfo

Info about what cluster a certain glyph belongs to.

ClusterIterator

Iterator over glyphs that returns information about the cluster that this glyph belongs to. Returned by the ScaledWord::cluster_iter() function.

FontMetrics
GlyphInfo
GlyphInstance
GlyphPosition
InlineTextLayout
LayoutedGlyphs

Returns the layouted glyph instances

ResolvedTextLayoutOptions

Same as TextLayoutOptions, but with the widths / heights of the PixelValues resolved to regular f32s (because letter_spacing, word_spacing, etc. may be %-based value)

ScaledWord

Word that is scaled (to a font / font instance), but not yet positioned

ScaledWords

A paragraph of words that are shaped and scaled (* but not yet layouted / positioned*!) according to their final size in pixels.

TextLayoutOptions

Layout options that can impact the flow of word positions

Word

Section of a certain type

WordPositions

Stores the positions of the vertically laid out texts

Words

Text broken up into Tab, Word(), Return characters

Enums

LineCaretIntersection
TextOverflow

Whether the text overflows the parent rectangle, and if yes, by how many pixels, necessary for determining if / how to show a scrollbar + aligning / centering text.

WordType

Either a white-space delimited word, tab or return character

Constants

DEFAULT_LETTER_SPACING
DEFAULT_LINE_HEIGHT
DEFAULT_TAB_WIDTH
DEFAULT_WORD_SPACING

Functions

advance_caret
caret_intersects_with_holes

Check if the caret intersects with any holes and if yes, if the cursor should move to a new line.

get_layouted_glyphs
get_line_y_position

For a given line number (NOTE: 0-indexed!), calculates the Y position of the bottom left corner

position_words

Positions the words on the screen (does not layout any glyph positions!), necessary for estimating the intrinsic width + height of the text content.

split_text_into_words

Splits the text by whitespace into logical units (word, tab, return, whitespace).

word_item_is_return
word_positions_to_inline_text_layout

Returns the (left-aligned!) bounding boxes of the indidividual text lines

words_to_scaled_words

Takes a text broken into semantic items and a font instance and scales the font accordingly.

Type Definitions

GlyphIndex
IndexOfLineBreak
LineBreaks
LineLength
RemainingSpaceToRight
WordIndex