text

package
v2.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 10, 2024 License: MIT Imports: 6 Imported by: 26

Documentation

Overview

Package text implements creation of texts.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(value string, ps ...props.Text) core.Component

New is responsible to create an instance of a Text.

Example

ExampleNew demonstrates how to create a text component.

m := maroto.New()

text := text.New("text")
col := col.New(12).Add(text)
m.AddRow(10, col)

// generate document
Output:

func NewAutoRow added in v2.1.0

func NewAutoRow(value string, ps ...props.Text) core.Row

NewAutoRow is responsible for creating an instance of Text grouped in a Line with automatic height.

func NewCol

func NewCol(size int, value string, ps ...props.Text) core.Col

NewCol is responsible to create an instance of a Text wrapped in a Col.

Example

ExampleNewCol demonstrates how to create a text component wrapped into a column.

m := maroto.New()

textCol := text.NewCol(12, "text")
m.AddRow(10, textCol)

// generate document
Output:

func NewRow

func NewRow(height float64, value string, ps ...props.Text) core.Row

NewRow is responsible to create an instance of a Text wrapped in a Row.

Example

ExampleNewRow demonstrates how to create a text component wrapped into a row.

m := maroto.New()

textRow := text.NewRow(10, "text")
m.AddRows(textRow)

// generate document
Output:

Types

type Text

type Text struct {
	// contains filtered or unexported fields
}

func (*Text) GetHeight added in v2.1.0

func (t *Text) GetHeight(provider core.Provider, cell *entity.Cell) float64

GetHeight returns the height that the text will have in the PDF

func (*Text) GetStructure

func (t *Text) GetStructure() *node.Node[core.Structure]

GetStructure returns the Structure of a Text.

func (*Text) Render

func (t *Text) Render(provider core.Provider, cell *entity.Cell)

Render renders a Text into a PDF context.

func (*Text) SetConfig

func (t *Text) SetConfig(config *entity.Config)

SetConfig sets the config.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL