package
0.0.0-20250209140343-015076d8ff76
Repository: https://github.com/tdewolff/canvas.git
Documentation: pkg.go.dev
# Functions
Box returns a box item of given width.
EmbeddingLevels returns the embedding levels for each rune of a mixed LTR/RTL string.
Glue returns a glue item where width is the default width, stretch*Tolerance the maximum width, and shrink*Tolerance the minimum width.
GlyphsToItems converts a slice of glyphs into the box/glue/penalty items model as used by Knuth's line breaking algorithm.
IsParagraphSeparator returns true for paragraph separator runes.
Linebreak breaks a list of items using Donald Knuth's line breaking algorithm.
LinebreakGlyphs breaks a slice of glyphs uing the given SFNT font and font size.
NewShaper returns a new text shaper.
NewShaperSFNT returns a new text shaper using a SFNT structure.
Penalty returns a panalty item with a given penalization factor.
ScriptItemizer divides the string in parts for each different script.
# Constants
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Direction.
see Type.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Align.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Direction.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
FairyTales is an example text.
see Script.
see Script.
see Type.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Align.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Align.
see Direction.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Type.
see Script.
see Script.
see Script.
see Script.
see Align.
see Direction.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Direction.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
see Script.
# Variables
Stretchability and shrinkability factors for inter-sentence and other types of spaces, not used if FrenchSpacing is set.
Stretchability and shrinkability factors for inter-sentence and other types of spaces, not used if FrenchSpacing is set.
DemeritsFitness is the badness rating for very different fitness ratings for consecutive lines.
DemeritsFlagged is the badness rating for two consecutive lines ending in hyphens.
DemeritsLine is the badness rating for an extra line.
FrenchSpacing enforces equal widths for inter-word and inter-sentence spaces.
HyphenPenalty is the aesthetic cost of ending a line in a hyphen.
in case of ratio, demerits become about 1e22.
Stretchability and shrinkability factors for inter-sentence and other types of spaces, not used if FrenchSpacing is set.
Stretchability and shrinkability factors for inter-sentence and other types of spaces, not used if FrenchSpacing is set.
SpaceShrink is the shrinkability of spaces.
SpaceStretch is the stretchability of spaces.
Tolerance is the maximum stretchability of the spaces of a line.
# Structs
Breakpoint is a (possible) break point in the string.
Breakpoints is a list of break points.
Glyph is a shaped glyph for the given font and font size.
Item is a box, glue or penalty item.
Shaper is a text shaper formatting a string in properly positioned glyphs.