Skip to main content

Crate deckcraft_text

Crate deckcraft_text 

Source
Expand description

Text layout for slide text bodies.

layout resolves every run’s formatting through the placeholder/style chain and lays each paragraph out in the order bidirectional text needs:

  1. embedding levels for the whole logical paragraph (UAX #9, base level from a:pPr/@rtl);
  2. itemization by level, script, face (per-cluster fallback through the a:latin/a:ea/a:cs slots and the theme’s script fonts) and shaping style, each item shaped with the whole paragraph as context; paint-only attributes (colour, highlight, underline) never split a word, so Arabic joining and ligatures survive them;
  3. line breaking in logical order (UAX #14 opportunities at cluster boundaries, greedy fill);
  4. per line, rules L1/L2 reorder the characters visually (L4 mirroring is done by the shaper).

It then places bullets and numbers from the paragraph’s start edge (the right edge for RTL paragraphs), applies indents, spacing and alignment (kashida for justLow), anchors the block in the shape’s text box, and shrinks text on overflow when the body asks for it. The result is positioned glyph runs in shape-local coordinates plus per-line caret geometry for editing: bidirectional carets with affinity, logical and visual movement, and selection as the union of visual boxes.

Modules§

datetime
Date and time fields (a:fld type="datetime…"): the text each field type shows for a moment, and the local clock.

Structs§

Deco
An underline, strikethrough or highlight box.
GlyphRun
A run of glyphs in one face, size and colour.
LineInfo
NoFields
Opts
Pos
A caret position: paragraph and character offset within it.
RunEffects
A text run’s shadow and glow, colours resolved.
TextLayout
TextShadow
An outer shadow: colour (with its alpha), blur radius and offset in points.

Enums§

Affinity
Which side of a boundary a caret belongs to: Downstream sticks to the character after it (the default), Upstream to the character before it, which differs at direction changes and at the end of a wrapped line.
MoveMode
Caret movement: through the text order, or across the screen.

Traits§

Fields
Values for fields (slidenum, datetime…, footer). None keeps the field’s saved text.

Functions§

autonum
Text of an auto-number bullet: arabicPeriod 3 → “3.”.
fit_height
Height the shape needs so its text fits (Resize shape to fit text): text height + insets.
fit_width
Width a non-wrapping text box needs.
layout
Lay out a shape’s text body.
symbol_char
The character that draws c, a character of text set in the symbol font font (Wingdings, Symbol, Webdings…: its code, or U+F000 + its code), with face: the installed symbol font’s own glyph when face is that font, else a Unicode look-alike as bullets use. None when font is not a symbol font or c is not a symbol code. Metafile text takes this path.