mirror of
https://github.com/unidoc/unipdf.git
synced 2025-05-02 22:17:06 +08:00
Add SetText method to the styled paragraph component
This commit is contained in:
parent
9db7496508
commit
8cbb57960d
@ -119,6 +119,12 @@ func (p *StyledParagraph) Reset() {
|
|||||||
p.chunks = []*TextChunk{}
|
p.chunks = []*TextChunk{}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SetText replaces all the of the paragraph with the specified one.
|
||||||
|
func (p *StyledParagraph) SetText(text string) *TextChunk {
|
||||||
|
p.Reset()
|
||||||
|
return p.Append(text)
|
||||||
|
}
|
||||||
|
|
||||||
// SetTextAlignment sets the horizontal alignment of the text within the space provided.
|
// SetTextAlignment sets the horizontal alignment of the text within the space provided.
|
||||||
func (p *StyledParagraph) SetTextAlignment(align TextAlignment) {
|
func (p *StyledParagraph) SetTextAlignment(align TextAlignment) {
|
||||||
p.alignment = align
|
p.alignment = align
|
||||||
|
Loading…
x
Reference in New Issue
Block a user