SetStringRot90 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 TB rotated layout (-90 deg). Be sure that OpenFont has been run so a valid Face is available. noBG ignores any BackgroundColor in f
(str string, fontSty *styles.FontRender, ctxt *units.Context, txtSty *styles.Text, noBG bool, scalex float32)
| 294 | // Be sure that OpenFont has been run so a valid Face is available. |
| 295 | // noBG ignores any BackgroundColor in font style, and never renders background color |
| 296 | func (tr *Text) SetStringRot90(str string, fontSty *styles.FontRender, ctxt *units.Context, txtSty *styles.Text, noBG bool, scalex float32) { |
| 297 | if len(tr.Spans) != 1 { |
| 298 | tr.Spans = make([]Span, 1) |
| 299 | } |
| 300 | tr.Links = nil |
| 301 | sr := &(tr.Spans[0]) |
| 302 | rot := float32(math32.Pi / 2) |
| 303 | sr.SetString(str, fontSty, ctxt, noBG, rot, scalex) |
| 304 | sr.SetRunePosTBRot(txtSty.LetterSpacing.Dots, txtSty.WordSpacing.Dots, fontSty.Face.Metrics.Ch, txtSty.TabSize) |
| 305 | ssz := sr.SizeHV() |
| 306 | vht := fontSty.Face.Face.Metrics().Height |
| 307 | tr.BBox.Min.SetZero() |
| 308 | tr.BBox.Max = math32.Vec2(math32.FromFixed(vht), ssz.Y) |
| 309 | } |
| 310 | |
| 311 | // SetRunes is for basic text rendering with a single style of text (see |
| 312 | // SetHTML for tag-formatted text) -- configures a single Span with the |