Skip to content
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

Closed
lukasmartinelli opened this issue Nov 24, 2016 · 2 comments
Closed

Choose Fonts and Glyphs Endpoints #18

lukasmartinelli opened this issue Nov 24, 2016 · 2 comments

Comments

@lukasmartinelli
Copy link
Collaborator

lukasmartinelli commented Nov 24, 2016

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

"glyphs": "https://orangemug.github.io/font-glyphs/glyphs/{fontstack}/{range}.pbf"

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..

{
  "fonts": {
    //font family as keys and all fontstacks in array
    "Open Sans": ["Open Sans Bold Italic", "Open Sans Bold", ...]
}

@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).

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.

font 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.

choose font

@orangemug
Copy link
Collaborator

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

@lukasmartinelli
Copy link
Collaborator Author

Font and glyph endpoint is done through the normal glyphs and sprite url of the style.
Optionally these endpoints can provide metadata.

If sprite url is https://openmaptiles.github.io/fiord-color-gl-style/sprite then we request the https://openmaptiles.github.io/fiord-color-gl-style/sprite.json file for the icons.

If glyphs url is http://fonts.openmaptiles.org/{fontstack}/{range}.pbf we request a http://fonts.openmaptiles.org/fontstacks.json file.

nyurik pushed a commit that referenced this issue Feb 12, 2024
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants