MCPcopy Create free account
hub / github.com/cogentcore/core / SetHTMLBytes

Method SetHTMLBytes

paint/text.go:419–425  ·  view source on GitHub ↗

SetHTMLBytes does SetHTML with bytes as input -- more efficient -- use this if already in bytes

(str []byte, font *styles.FontRender, txtSty *styles.Text, ctxt *units.Context, cssAgg map[string]any)

Source from the content-addressed store, hash-verified

417// SetHTMLBytes does SetHTML with bytes as input -- more efficient -- use this
418// if already in bytes
419func (tr *Text) SetHTMLBytes(str []byte, font *styles.FontRender, txtSty *styles.Text, ctxt *units.Context, cssAgg map[string]any) {
420 if txtSty.HasPre() {
421 tr.SetHTMLPre(str, font, txtSty, ctxt, cssAgg)
422 } else {
423 tr.SetHTMLNoPre(str, font, txtSty, ctxt, cssAgg)
424 }
425}
426
427// This is the No-Pre parser that uses the golang XML decoder system, which
428// strips all whitespace and is thus unsuitable for any Pre case

Callers

nothing calls this directly

Calls 3

SetHTMLPreMethod · 0.95
SetHTMLNoPreMethod · 0.95
HasPreMethod · 0.80

Tested by

no test coverage detected