Documentation
¶
Overview ¶
Transform a "before layout" box tree into an "after layout" tree, by breaking boxes across lines and pages; and determining the position and dimension of each box fragment.
Boxes in the new tree have `used values` in their PositionX, PositionY, Width and Height attributes, amongst others. (see https://www.w3.org/TR/CSS21/cascade.html#used-value)
The laid out pages are ready to be printed or display on screen, which is done by the higher level `document` package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Layout ¶
func Layout(html *tree.HTML, stylesheets []tree.CSS, presentationalHints bool, fontConfig *text.FontConfiguration) []*bo.PageBox
Layout lay out the whole document, returning one box per pages.
This includes line breaks, page breaks, absolute size and position for all boxes.
func LayoutReplacedBox ¶
func LayoutReplacedBox(box_ bo.ReplacedBoxITF) (drawWidth, drawHeight, positionX, positionY pr.Float)
LayoutReplacedBox computes the dimension of the content of a replaced box.
Types ¶
type AbsolutePlaceholder ¶
type AbsolutePlaceholder struct { AliasBox // contains filtered or unexported fields }
AbsolutePlaceholder is left where an absolutely-positioned box was taken out of the flow.
func NewAbsolutePlaceholder ¶
func NewAbsolutePlaceholder(box Box) *AbsolutePlaceholder
func (AbsolutePlaceholder) Copy ¶
func (abs AbsolutePlaceholder) Copy() Box
func (AbsolutePlaceholder) IsClassicalBox ¶
func (AbsolutePlaceholder) IsClassicalBox() bool
func (AbsolutePlaceholder) String ¶
func (abs AbsolutePlaceholder) String() string