Skip to content

versatiles-org/versatiles-fonts

Repository files navigation

Code Coverage CI Status Latest Release Downloads

VersaTiles Fonts

VersaTiles Fonts provides free font glyphs tailored for map rendering.

Installation

Clone the repository and install dependencies:

git clone [email protected]:versatiles-org/versatiles-fonts.git
cd versatiles-fonts
npm install

Building

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.

Available Fonts

VersaTiles Fonts includes the following font families:

Adding Custom Fonts

To add your own fonts:

  1. Create a folder within fonts containing the *.ttf or *.otf files of the desired font.
  2. 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.
  3. If you need custom file names or want to merge multiple *.ttf/*.otf files (e.g., when combining character sets exceeding 64K chars), create a fonts.json file. Refer to the fonts/Noto Sans/ directory for an example configuration.