You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to make the font service working, I stumbled across a small problem that is easy to fix, but not so easy to find out why it didn't work (at least for me).
2024-07-28T10:59:28Z DEBUG actix_web::types::path] Failed during Path extractor deserialization. Request path: "/font/Open%20Sans%20Regular/0-255.pbf"
[2024-07-28T10:59:28Z DEBUG actix_web::middleware::logger] Error in response: Error("can not parse "255.pbf" to a u32")
Ideally there would be either a pointer in the documentation how the glyph urls need to look like or the server would automatically detect such pbf urls and handle them correctly.
Thanks for this great server. I really enjoy tinkering with it!
The text was updated successfully, but these errors were encountered:
bzeiss
added a commit
to bzeiss/martin
that referenced
this issue
Jul 28, 2024
When trying to make the font service working, I stumbled across a small problem that is easy to fix, but not so easy to find out why it didn't work (at least for me).
I'm using a tilemaker mbtiles file together with publicly available openmaptiles style, for example, https://github.com/openmaptiles/osm-bright-gl-style/blob/master/style.json. Practically all openmapstyle styles listed on https://openmaptiles.org/styles/, have one thing in common in how they specify the glph url. They do it as something like
"glyphs": "https://api.maptiler.com/fonts/{fontstack}/{range}.pbf?key={key}",
When I first tried to make Martin work as glyph server, I adapted the url to
"glyphs": "font/{fontstack}/{range}.pbf"
This didn't work. Martin successfully scanned the font directory that I have provided:
Configured font Open Sans Regular with 883 glyphs (0020-FFFD) from fonts/open-sans/OpenSans-Regular.ttf
But when I tried to access the service with http://localhost:3000/font/Open%20Sans%20Regular/0-255.pbf as I have watched maplibre request the glyphs, I would get a response "can not parse "255.pbf" to a u32".
After enabling the debug logs, I got
2024-07-28T10:59:28Z DEBUG actix_web::types::path] Failed during Path extractor deserialization. Request path: "/font/Open%20Sans%20Regular/0-255.pbf"
[2024-07-28T10:59:28Z DEBUG actix_web::middleware::logger] Error in response: Error("can not parse "255.pbf" to a u32")
After some tinkering, I found out that http://localhost:3000/font/Open%20Sans%20Regular/0-255 works, but http://localhost:3000/font/Open%20Sans%20Regular/0-255 .pbf doesn't. After changing the glyph urls in the styles to "glyphs": "font/{fontstack}/{range}", everything started to work perfectly.
Ideally there would be either a pointer in the documentation how the glyph urls need to look like or the server would automatically detect such pbf urls and handle them correctly.
Thanks for this great server. I really enjoy tinkering with it!
The text was updated successfully, but these errors were encountered: