Atlaslog / Field Notes / Styling & rendering
Field note · Styling & rendering
glyphs 404 leaves every label blank
Quick answer
Icons and polygons render but no text appears, and the network panel shows the glyph PBF ranges returning 404. The font stack name does not match the server's `fonts/` directory, and the Chinese Unicode ranges were never generated.
Symptom
- `GET /fonts/Microsoft%20YaHei%20Regular/0-255.pbf` returns `404 Not Found`, and the same for `256-511.pbf`
- The console reports `Error: Failed to load glyphs: 404` without stopping the map
- `text-field` and the source names are correct, yet `queryRenderedFeatures` returns no labels
Checklist
- Filter the network panel by `pbf` and list which ranges return 404
- Open one glyph URL directly to confirm the file is absent
- Compare the `glyphs` template's font stack with the server directory name character by character
- Check whether the font directory contains CJK ranges such as `19968-20223`
- Check that every name in `text-font` exists under `fonts/`
Fix
Generate glyph PBFs that include the CJK ranges, point `glyphs` at `.../fonts/{fontstack}/{range}.pbf`, and set `text-font: ['Noto Sans SC Regular']`; on MapLibre also set `localIdeographFontFamily: "'Microsoft YaHei', 'PingFang SC', sans-serif"`.
Code
GET /fonts/Microsoft%20YaHei%20Regular/0-255.pbf 404 Not Found
GET /fonts/Microsoft%20YaHei%20Regular/256-511.pbf 404 Not Found"glyphs": "https://example.com/fonts/{fontstack}/{range}.pbf",
"layers": [{
"id": "label",
"type": "symbol",
"layout": {
"text-field": ["get", "name"],
"text-font": ["Microsoft YaHei Regular"] // 必须与目录名一致
}
}]
Watch out
- Copying only `0-255.pbf` from a Latin font set and expecting Chinese labels to appear
- Renaming the font folder without updating `text-font`, which keeps requesting a path that does not exist
English edition written for Atlaslog from the original Chinese field note. Code is unchanged and runs as-is.
Atlaslog (2026). glyphs 404 leaves every label blank. https://www.jingweizhi.com/en/cookbook/glyphs-404.html (accessed 2026-11-03).