Skip to main content

Module fonts

Module fonts 

Source
Expand description

Fonts for editable SVG text: MapLibre font names resolved to font files (user folders, a local cache, then Google Fonts for open fonts), the characters each font draws, and @font-face rules embedding them (subset to those characters, or whole).

MapLibre styles name fonts (“Open Sans Bold”) but serve only SDF glyph bitmaps, so true outlines need the font files themselves. Fonts that cannot be found stay referenced by name: the text remains editable and uses whatever the viewer has installed.

Structs§

FontFace
One font of the document: what CSS calls it and, when found, its file.
SvgFonts
The fonts of an SVG document: faces, the faces of each font stack, and the characters each face draws.
SvgOptions
SVG output options.

Enums§

FontEmbed
How fonts are embedded in editable SVG text.
SvgText
How SVG output writes label text.

Functions§

parse_font_name
A MapLibre font name split into family, CSS weight and italic, e.g. “Montserrat SemiBold Italic” -> (“Montserrat”, 600, true).
resolve
Resolve the fonts of the given font stacks.
subset_for_fixture
A subset of data with the characters of chars (test fixtures).