extends Typesettable
A ParagraphNode
is a single paragraph containing text and images that will be typeset into lines.
new ParagraphNode(
context
: Context
?, properties
: Object? )
Creates a new ParagraphNode
with a typesetting context and the specified properties. properties
should just contain the properties listed below.
context
: Context
Default: null
The node’s typesetting context.
indent
: booleanDefault: false
When true, the paragraph will be indented.
double
: booleanDefault: false
When true, the paragraph will have a top margin.
quote
: booleanDefault: false
When true, the paragraph will have padding around it.
separator
: booleanDefault: false
When true, the paragraph will be marked as a section separator (like <hr>
). This means that the lines should not be distributed across multiple pages.
join
: booleanDefault: false
When quote
is true, this determines whether or not this paragraph will be joined with the previous. Effectively, this means that when join
is false
, the quote top padding will be added in a line.
joinNext
: booleanDefault: false
This is basically the same as join
, except this determines whether or not this paragraph will be joined with the next.
align
: numberDefault: 0
The text align.
0
: Justified1
: Left2
: Center3
: Rightlist
: numberDefault: 0
The list type. This is currently not implemented.
0
: Disabled1
: Unordered list2
: Ordered listheader
: numberDefault: 0
The header type. This is currently not implemented.
0
: Disabled1
: H12
: H26
: H6split
: booleanDefault: false
Currently not implemented.
When this is true, this paragraph will be treated as if it were the second part of a paragraph split across two pages, thus disabling double-spacing or indentation.
content
: ArrayThe paragraph content, containing things like TextNodes and ImageNodes.
lines
: Line
[]After calling typeset()
, this will be populated with Line
s.
copyFrom(
paragraphNode
: ParagraphNode)
This will copy all properties from another ParagraphNode to this one.
append(
child
: any)
This will add a child to the content
, unless it’s a duplicate.
typeset()
This will typeset this ParagraphNode, create Lines, and put them in lines
.