VersaTiles Fonts provides free font glyphs tailored for map rendering.
Clone the repository:
git clone git@github.com:versatiles-org/versatiles-fonts.git
cd versatiles-fontsBuilding requires the versatiles_glyphs binary. Install it with:
curl -Ls "https://github.com/versatiles-org/versatiles-glyphs-rs/raw/refs/heads/main/scripts/install.sh" | shTo generate the font files, run:
npm run buildThis will create:
- A
dist/fonts.tar.gzarchive containing all glyphs. - Separate archives
dist/{font_family}.tar.gzfor each individual font family.
Which families are packaged is driven by fonts.config.ts (the build section), so no font list is hardcoded in the build script.
VersaTiles Fonts includes the following font families:
- Fira Sans by Chris Apostrophe - OFL
- Lato by Łukasz Dziedzic - OFL
- Libre Baskerville by Impallari Type - OFL
- Merriweather Sans by Sorkin Type - OFL
- Noto Sans by Google - OFL
- Nunito by Vernon Adams, Cyreal, and Jacques Le Bailly - OFL
- Open Sans by Steve Matteson - OFL
- PT Sans by ParaType - OFL
- Roboto by Christian Robertson - Apache 2.0 License
- Roboto Condensed by Christian Robertson - OFL
- Source Sans 3 by Paul D. Hunt - OFL
To add your own fonts:
- Create a folder within
fontscontaining the*.ttfor*.otffiles of the desired font. - Ensure that the font files adhere to the following naming convention:
$family: The font family name, including any variations (e.g., "Condensed", "Extra Condensed", "Narrow", ...).$style: The font style, such as "Thin", "Extra Light", "Light", "Medium", "Regular", "Semi Bold", "Bold", "Extra Bold", or "Black", optionally followed by "Italic".- File naming format:
fonts/$family/$family - $style.ttf.
- If you need custom file names or want to merge multiple
*.ttf/*.otffiles (e.g., when combining character sets exceeding 64K chars), create afonts.jsonfile. Refer to thefonts/Noto Sans/directory for an example configuration.