VersaTiles Fonts provides free font glyphs tailored for map rendering.
Clone the repository and install dependencies:
git clone [email protected]:versatiles-org/versatiles-fonts.git
cd versatiles-fonts
npm install
To generate the font files, run:
npm run build
This will create:
- A
dist/fonts.tar.gz
archive containing all glyphs. - Separate archives
dist/{font_family}.tar.gz
for each individual font family.
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
- Source Sans 3 by Paul D. Hunt - OFL
To add your own fonts:
- Create a folder within
fonts
containing the*.ttf
or*.otf
files 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
/*.otf
files (e.g., when combining character sets exceeding 64K chars), create afonts.json
file. Refer to thefonts/Noto Sans/
directory for an example configuration.