SetRunes is for basic text rendering with a single style of text (see SetHTML for tag-formatted text) -- configures a single Span with the entire string, and does standard layout (LR currently). rot and scalex are general rotation and x-scaling to apply to all chars -- alternatively can apply these
(str []rune, fontSty *styles.FontRender, ctxt *units.Context, txtSty *styles.Text, noBG bool, rot, scalex float32)
| 316 | // valid Face is available. noBG ignores any BackgroundColor in font style, and never |
| 317 | // renders background color |
| 318 | func (tr *Text) SetRunes(str []rune, fontSty *styles.FontRender, ctxt *units.Context, txtSty *styles.Text, noBG bool, rot, scalex float32) { |
| 319 | if len(tr.Spans) != 1 { |
| 320 | tr.Spans = make([]Span, 1) |
| 321 | } |
| 322 | tr.Links = nil |
| 323 | sr := &(tr.Spans[0]) |
| 324 | sr.SetRunes(str, fontSty, ctxt, noBG, rot, scalex) |
| 325 | sr.SetRunePosLR(txtSty.LetterSpacing.Dots, txtSty.WordSpacing.Dots, fontSty.Face.Metrics.Ch, txtSty.TabSize) |
| 326 | ssz := sr.SizeHV() |
| 327 | vht := fontSty.Face.Face.Metrics().Height |
| 328 | tr.BBox.Min.SetZero() |
| 329 | tr.BBox.Max = math32.Vec2(ssz.X, math32.FromFixed(vht)) |
| 330 | } |
| 331 | |
| 332 | // SetHTMLSimpleTag sets the styling parameters for simple html style tags |
| 333 | // that only require updating the given font spec values -- returns true if handled |
no test coverage detected