MCPcopy Create free account
hub / github.com/andlabs/ui / DrawNewTextLayout

Function DrawNewTextLayout

drawtext.go:489–500  ·  view source on GitHub ↗

DrawNewTextLayout() creates a new DrawTextLayout from the given parameters.

(p *DrawTextLayoutParams)

Source from the content-addressed store, hash-verified

487// DrawNewTextLayout() creates a new DrawTextLayout from
488// the given parameters.
489func DrawNewTextLayout(p *DrawTextLayoutParams) *DrawTextLayout {
490 dp := C.pkguiNewDrawTextLayoutParams()
491 defer C.pkguiFreeDrawTextLayoutParams(dp)
492 dp.String = p.String.s
493 dp.DefaultFont = p.DefaultFont.toLibui()
494 defer freeLibuiFontDescriptor(dp.DefaultFont)
495 dp.Width = C.double(p.Width)
496 dp.Align = C.uiDrawTextAlign(p.Align)
497 return &DrawTextLayout{
498 tl: C.uiDrawNewTextLayout(dp),
499 }
500}
501
502// Free frees tl. The underlying AttributedString is not freed.
503func (tl *DrawTextLayout) Free() {

Callers

nothing calls this directly

Calls 2

freeLibuiFontDescriptorFunction · 0.85
toLibuiMethod · 0.65

Tested by

no test coverage detected