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

Support Fonts List #1610

Open
artyomb opened this issue Dec 12, 2024 · 11 comments · May be fixed by #1612
Open

Support Fonts List #1610

artyomb opened this issue Dec 12, 2024 · 11 comments · May be fixed by #1612
Labels

Comments

@artyomb
Copy link

artyomb commented Dec 12, 2024

When using with Maputnik the Glyph url from Martin (https://martin./font/{fontstack}/{range}), Maputnik tries to get the list of available font names by the url:
https://martin./font/%7Bfontstack%7D/%7Brange%7D.

That would be great to have Matrtin provide that list.

@CommanderStorm
Copy link
Collaborator

Which map Software are you using that requests this template instead of subsituting the values?
Maplibre for example should replace the {fontstack}/.. variables: https://maplibre.org/maplibre-style-spec/glyphs/

@artyomb
Copy link
Author

artyomb commented Dec 13, 2024

I use Maputnik (https://github.com/maplibre/maputnik).
In the UI interface, when you select the font for the Symbol text it tries to get list of available fonts from the two version of urls:

  • First it requests GET https://martin.domain/font/{fontstack}/{range}

  • Second case it calls GET https://martin.domain/font.json

I didn’t quite understand when each of them is used. But for the given case it calls GET https://martin.domain/font/{fontstack}/{range}

For now, I implemented this endpoint in the middleware where I call the GET /catalog and use "fonts" section.

@CommanderStorm

This comment has been minimized.

@artyomb
Copy link
Author

artyomb commented Dec 13, 2024

  1. Fonts are working
  2. Fonts list doesn't work

Maputnik requests GET https://martin.domain/font/{fontstack}/{range} to show available font in the font selection box
Image

@CommanderStorm
Copy link
Collaborator

Ah, I see.

I don't see a request to

  • font.json or
  • fontstack.json as refered here.

This may be related to maplibre/maputnik#945, I have not looked into this further.

Suplying /font/{fontstack}/{range} as a [fontstack] does seem to work:
Image

Will provide a PR as such

@nyurik
Copy link
Member

nyurik commented Dec 13, 2024

Don't we already have this as part of the /catalog ? We might not have released it yet though

@CommanderStorm CommanderStorm linked a pull request Dec 13, 2024 that will close this issue
@CommanderStorm
Copy link
Collaborator

Yes, the information is avaliable.
Thing is that we can't realistically ask maputnik to support the /catalog format (can we?)

@nyurik
Copy link
Member

nyurik commented Dec 13, 2024

sure can :)

@nyurik
Copy link
Member

nyurik commented Dec 13, 2024

So yes, if we already publish the needed information, lets get maputnik to support that. If on the other hand this is part of a osgeo or similar standard api, than we may consider adding that. I don't think we should be adding multiple non-standard apis for the same functionality

@CommanderStorm
Copy link
Collaborator

The code maputnik currently uses to load the metadata looks like this (=> no standard is mentioned 🤔):

https://github.com/maplibre/maputnik/blob/c6174a57d9f934a1569f45edafca48859f799c0f/src/libs/metadata.ts#L20-L35

@nyurik
Copy link
Member

nyurik commented Dec 13, 2024

The only relevant standards i'm aware of are various OGC API standards like the one for the tiles. BTW, at some point we should support it -- i created #1613. See also https://ogcapi.ogc.org/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants