TextStyle-based Layout Routines Layout does basic standard layout of text using Text style parameters, assigning relative positions to spans and runes according to given styles, and given size overall box. Nonzero values used to constrain, with the width used as a hard constraint to drive word wra
(txtSty *styles.Text, fontSty *styles.FontRender, ctxt *units.Context, size math32.Vector2)
| 166 | // Font face in styles.Font is used for determining line spacing here. |
| 167 | // Other versions can do more expensive calculations of variable line spacing as needed. |
| 168 | func (tr *Text) Layout(txtSty *styles.Text, fontSty *styles.FontRender, ctxt *units.Context, size math32.Vector2) math32.Vector2 { |
| 169 | // todo: switch on layout types once others are supported |
| 170 | return tr.LayoutStdLR(txtSty, fontSty, ctxt, size) |
| 171 | } |
| 172 | |
| 173 | // LayoutStdLR does basic standard layout of text in LR direction. |
| 174 | func (tr *Text) LayoutStdLR(txtSty *styles.Text, fontSty *styles.FontRender, ctxt *units.Context, size math32.Vector2) math32.Vector2 { |