textdraw

package
v1.15.0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2026 License: BSD-3-Clause Imports: 2 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

func Expand(op ui.OpDrawParagraph, ctm *ui.Matrix4, emit func(ui.DisplayOp, *ui.Matrix4)) bool

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

Jump to

Keyboard shortcuts

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