Expand description
Contains functions for breaking a string into words, calculate the positions of words / lines and do glyph positioning
Re-exports§
pub use super::shaping::ParsedFont;
Structs§
- Font
Metrics - FontRef
- Glyph
Instance - Inline
Text - inline text so that hit-testing is easier
- Inline
Text Layout - Layouted
Glyphs - Returns the layouted glyph instances
- Logical
Position - Logical
Rect - Logical
Size - Resolved
Text Layout Options - Same as
TextLayoutOptions
, but with the widths / heights of thePixelValue
s resolved to regular f32s (becauseletter_spacing
,word_spacing
, etc. may be %-based value) - Shaped
Word - Word that is scaled (to a font / font instance), but not yet positioned
- Shaped
Words - A paragraph of words that are shaped and scaled (* but not yet layouted / positioned*!) according to their final size in pixels.
- Text
Layout Options - Layout options that can impact the flow of word positions
- Word
- Section of a certain type
- Word
Positions - Stores the positions of the vertically laid out texts
- Words
- Text broken up into
Tab
,Word()
,Return
characters
Enums§
- Word
Type - Either a white-space delimited word, tab or return character
Constants§
Functions§
- parse_
font - Creates a font from a font file (TTF, OTF, WOFF, etc.)
- 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.
- shape_
text - shape_
words - Takes a text broken into semantic items and shape all the words (does NOT scale the words, only shapes them)
- split_
text_ into_ words - Splits the text by whitespace into logical units (word, tab, return, whitespace).
- word_
positions_ to_ inline_ text_ layout - Returns the (left-aligned!) bounding boxes of the indidividual text lines