DrawNewTextLayout() creates a new DrawTextLayout from the given parameters.
(p *DrawTextLayoutParams)
| 487 | // DrawNewTextLayout() creates a new DrawTextLayout from |
| 488 | // the given parameters. |
| 489 | func 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. |
| 503 | func (tl *DrawTextLayout) Free() { |
nothing calls this directly
no test coverage detected