-
-
Notifications
You must be signed in to change notification settings - Fork 376
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Choose Fonts and Glyphs Endpoints #18
Comments
With regards to the font metadata endpoint, v2 of font-glyphs has implemented something similar https://orangemug.github.io/font-glyphs-v2/glyphs/index.json. Also apologies for the delay |
Font and glyph endpoint is done through the normal If sprite url is If glyphs url is |
* Refactor into a go module `go get` is no longer supported outside of a go module. This commit converts the project into a go module, moving dependencies into a go.mod file. * Use go.rice instead of go-bindata-assetfs go.rice appears to be maintained and more popular * Edit dependencies * Pin to specific versions * Updating workflows * Fix syntax, I hope * Update go * Increment version number * Version number * version number
For at least Mapbox GL you will need to choose your font/glyphs endpoint.
https://www.mapbox.com/mapbox-gl-style-spec/#glyphs
Example:
Via HTTP
Font Metadata Endpoint
It is not just enough to know the endpoint of the glyphs but one also wants to know which fontstacks are available.
Therefore everyone who hosts fonts needs to provide a font metadata endpoint delivering information in a format similar to this.
Think more about format..
@orangemug Would you like to think about a metadata endpoint and deploy it to your repo so we have a working implementation? You have already digged into fonts quite a bit 😉
Serve Fonts
Public fonts can be hosted via GitHub pages (where the metadata JSON file can be stored as well).
@orangemug has done some nice work on how to provide a fonts metadata endpoint from GitHub and serve the fonts through GitHub pages (more info in #10 and maputnik/osm-liberty#1).
https://orangemug.github.io/font-glyphs/glyphs/{fontstack}/{range}.pbf
.Choosing your Font Endpoint
Then in the settings you can choose your font endpoint.
80% of the users will never need to change their font endpoint - they will be just fine choosing
fonts from the default endpoint.
Choose Font
In fields like
text-font
https://www.mapbox.com/mapbox-gl-style-spec/#layout-symbol-text-font you will then choose the font. This is where the font endpoint comes into play to display all available fonts.The text was updated successfully, but these errors were encountered: