Module layout

Source
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§

FontMetrics
FontRef
GlyphInstance
InlineText
inline text so that hit-testing is easier
InlineTextLayout
LayoutedGlyphs
Returns the layouted glyph instances
LogicalPosition
LogicalRect
LogicalSize
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)
ShapedWord
Word that is scaled (to a font / font instance), but not yet positioned
ShapedWords
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§

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§

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

Type Aliases§

GlyphIndex
IndexOfLineBreak
LineBreaks
LineLength
RemainingSpaceToRight
WordIndex