The Americana fontstack is built from Google Fonts. The name "fontstack66" is a nod to Historic Route 66.
glyphs: "https://font.americanamap.org/{fontstack}/{range}.pbf"
Then, in a maplibre-gl stylesheet, you can use the packaged fonts like such:
"text-font": ["Americana-Bold"]
In order to add fontstack support, modify the fonts.json
file as follows:
- Add font-family and variant information to the
font-families
section. The font-family is the name of the font as listed on Google Fonts, e.g. "Noto Sans". Usegfi download "<name of font>"
to get a full list of the variants. The variant is everything to the right of the dash in the filename, so if a file is namedNotoSans-700.ttf
, the variant is700
, though it will be listed in Google as something like "Bold 700". Thegfi
command requires you to install thegoogle-font-installer
package into npm withnpm install -g google-font-installer
. - Define the range of characters that you want rendered in this font in the
glyph-ranges
section. Since this is JSON, you'll have to convert hex to decimal here. The named parameter is simply a name that is used in the rest of the file to refer to this range of characters. This is an inclusive range so for example[0, 255]
will include codepoint 0 and codepoint 255. - The
custom-font-stacks
section lists each font-stack and which font/glyph range combinations should be included in that fontstack. - The
bundle-font-stacks
section lists all font stacks which should be bundled in their original form.
The following fonts are provided:
- Americana - based on Noto Sans Regular, generally 400 weight
- Americana-Bold - based on Noto Sans Regular, generally 700 weight
- Americana-Italic - an italic version of Americana
- Americana-Bold-Italic an italic version of Americana-Bold
- Noto Sans HK - Hong Kong Han ideograms
- Noto Sans JP - Hiragana, Katakana and Kanji
- Noto Sans KR - Hangul and the Korean Hanja scripts
- Noto Sans SC - Simplified Chinese variant of the Han ideograms.
- Noto Sans TC - Traditional Chinese variant of the Han ideograms