Documentation
¶
Overview ¶
Package textdraw turns the drawing of a paragraph into ordinary drawing operations, for the renderers: each glyph is a path, drawn with its origin on a quarter of a pixel horizontally and on a pixel vertically, so that the coverage of a glyph at a size can be cached for the four subpixel positions (SPEC §9.1).
Flutter: no counterpart
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Bounds ¶
func Bounds(op ui.OpDrawParagraph) (ui.Rect, bool)
Bounds returns a rectangle that holds everything the paragraph draws, in the coordinates of the paragraph's operation (its offset applied), and false when the paragraph cannot tell without being expanded: a caller then expands it.
Flutter: no counterpart
func Expand ¶
Expand calls emit with each operation that draws the paragraph at offset, under the transform ctm, with the transform to draw it under. It returns false, emitting nothing, if the paragraph cannot draw itself. The transform that emit receives is valid only until emit returns: a caller that keeps it copies it.
Flutter: no counterpart
func ExpandVisible ¶
func ExpandVisible(op ui.OpDrawParagraph, ctm *ui.Matrix4, visible ui.Rect, emit func(ui.DisplayOp, *ui.Matrix4)) bool
ExpandVisible is Expand for a caller that draws only the part of the paragraph that lies in visible, a rectangle of the surface in the coordinates that ctm maps to: the lines of a paragraph that lie wholly outside it are not expanded, so that a screenful of a long text costs what the screenful costs. It may emit operations outside visible (the caller's clip removes them), and all of those inside.
Flutter: no counterpart
Types ¶
type BoundsPainter ¶
type BoundsPainter interface {
// PaintBounds is a rectangle, in the coordinates of the paragraph, that holds everything
// PaintParagraph emits (it may be larger).
PaintBounds() ui.Rect
}
BoundsPainter is a paragraph painter that knows a rectangle that holds everything it draws, without drawing it. The layout of the text engine is one.
Flutter: no counterpart
type RowPainter ¶
type RowPainter interface {
// PaintParagraphRows is PaintParagraph for the lines that may reach the rows from top to
// bottom, in the coordinates of the paragraph; it may emit more.
PaintParagraphRows(top, bottom float64, emit func(ui.ParagraphDraw))
}
RowPainter is a paragraph painter that can leave out the lines that lie outside a range of rows. The layout of the text engine is one.
Flutter: no counterpart