Skip to main content

Module msdf

Module msdf 

Source

Structs§

Params
how a size class of the atlas makes its tiles: texels per em, the distance range (texels, both sides together), the texels around the glyph’s box
Tile
a glyph’s field: w x h texels of RGBA (row 0 the lowest), texel (i, j) centred at ((x0 + i + 0.5) / em, (y0 + j + 0.5) / em) em units

Enums§

Seg
a segment of a contour (em units, y up)

Constants§

CORNER_CROSS
a corner is a turn whose cross product of the unit directions exceeds this (sin 3 rad, msdfgen’s default angle) or that turns back (dot <= 0)

Functions§

bounds
the box of the contours’ control hulls (None: no segment)
contours_of
the outline as quadratic and cubic segments from lib/text’s outline buffer (font units, TrueType contours with their implied on-curve midpoints, CFF contours of cubics), scaled by s (1 / units per em: em units)
ink_area
the area the contours fill (non-zero; em units squared), each segment as 16 chords: what a glyph’s ink weighs
tile
a glyph’s tile (None: no outline). contours in em units, y up, closed (each segment starts where the one before ended); fill rule non-zero
tile_box
the tile’s texel box for contours of this box: (x0, y0, w, h) in texels of the class

Type Aliases§

P