Documentation
¶
Overview ¶
Package textrun holds what the renderers of BDF text share: how a string of a FILL_TEXT is put in visual order, where its baseline lies, which families a font reference names, and the bold and italic that are synthesized for a face that has none. The renderers (raster/imagebdf, vector/pdfbdf) draw text the same way with it.
Index ¶
Constants ¶
const FakeItalicSkew = 0.25
FakeItalicSkew is the slant of synthesized italic (x per unit of height).
Variables ¶
var GenericFamilies = map[string]string{ "sans-serif": fontdb.Sans, "serif": fontdb.Serif, "monospace": fontdb.Mono, "cursive": fontdb.Sans, "fantasy": fontdb.Sans, "system-ui": fontdb.Sans, "math": fontdb.Serif, "ui-sans-serif": fontdb.Sans, "ui-serif": fontdb.Serif, "ui-monospace": fontdb.Mono, "ui-rounded": fontdb.Sans, }
GenericFamilies maps CSS generic family keywords to the generic families of fontdb.
Functions ¶
func BaselineShift ¶
BaselineShift is how far below the anchor the alphabetic baseline lies for a textBaseline, from the em box of a face with the ascent asc and the descent dsc in em, both positive (as Blink does).
func FakeBoldWidth ¶
FakeBoldWidth is the outline growth of synthesized bold for a size in device pixels (Skia's interpolation between 1/24 at 9 px and 1/32 at 36 px).
func SplitFamilies ¶
SplitFamilies splits a CSS font-family list into names without quotes.
func VisualOrder ¶
VisualOrder reorders a string for display: runs of right-to-left characters are reversed, and so is the order of the runs in a right-to-left paragraph. It covers what previews need, not the whole Unicode bidirectional algorithm (no mirroring, no Arabic shaping).
Types ¶
This section is empty.