-
Notifications
You must be signed in to change notification settings - Fork 827
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
RFC for strategy on font management #5043
Comments
Looks a very sensible overall strategy to me. Am I right in thinking that #4893 would address the acute problem in the meantime? |
This is great! Glad that this is more achievable with the new Python script. Here's where I'm at:
|
Probably should mention the other strategic issue w.r.t. fonts we have - the need to choose fonts based on language because different character designs being mandated by different languages despite using the same unicode code points - see #2208. This is not directly related to the topics here - but relevant regarding the question if our text rendering sufficiently covers all writings used in OSM world wide. |
I did a mini investigation of #2208. The difficulty is finding CartoCSS which could identify a country, city names within a country, or interpret from text, because CartoCSS doesn't have spatial filters.
|
Re: the YAML for fonts, are you picturing a schema like this? fonts:
NotoSans:
regular:
- https://github.com/notofonts/noto-fonts/raw/main/hinted/ttf/NotoSans/NotoSans-Regular.ttf
- [theoretical backup url]
bold:
- https://github.com/notofonts/noto-fonts/raw/main/hinted/ttf/NotoSans/NotoSans-Bold.ttf
italic:
- https://github.com/notofonts/noto-fonts/raw/main/hinted/ttf/NotoSans/NotoSans-Italic.ttf
NotoSansMyanmarUI:
regular:
- https://github.com/notofonts/noto-fonts/raw/main/hinted/ttf/NotoSansMyanmarUI/NotoSansMyanmarUI-Regular.ttf or more like the CartoCSS book-fonts:
NotoSans-Regular:
- https://github.com/notofonts/noto-fonts/raw/main/hinted/ttf/NotoSans/NotoSans-Regular.ttf
- [theoretical backup url]
NotoSansMyanmarUI-Regular:
- [url]
bold-fonts:
NotoSans-Bold:
- [...] |
The ease of maintenance should be the primary concern here. The main maintenance tasks that need to be considered are probably:
In terms of future feature additions there is in particular the potential need to
With all of that in mind i have doubts that having one big tree structure in the YAML file is the best approach. But this is just a gut feeling, i have not thought it through. I'd probably start with the data structures you have so far in python and think how this can be improved to be more maintenance friendly. Note you definitely don't need to have all URLs encoded literally. You can use format strings to define the form of URLs where it follows a well defined principle. The only thing you cannot do with the font definitions in YAML is having code (like with |
I agree that's too many URLs. I want to narrow down what works in the middle between every URL and the two format strings proposed in #5053. If I specify a URL for each language/font such as |
That has been considered in a few contexts e.g. here and, in a related discussion on multiple languages in labels here. It's not clear to me whether the move to the flex osm2pgsql helps at all here. You could imagine creating a table of geographic zones e.g. from suitably tagged admin boundaries. I think the challenge is how you maintain the tables and any derived "helper tagging" in the face of updates. You might need a "coastline" approach, where the tables/indices for "what language is the point in" are only updated infrequently. The |
Here's my YAML concept: Here the key is the font name (NotoSansArmenian, NotoSerifTibetan), it can have non-Regular variations (Bold), and support for multiple URLs. Then the script writes it into the MSS. I included the changes to MSS in the commit so you can see the result is about the same, except order of CJK. Small issue here is assumptions about relative paths to |
Some good news re Han Unification: Mapnik merged a PR to accept a The real question is how we select which features get these labels. @dch0ph's links show that OSM hasn't settled on a tag, and I agree that the coastline / generated column script is the most realistic one for querying a geo area. I tested some queries in Hong Kong (https://github.com/mapmeld/osm2pgsql-cjk?tab=readme-ov-file#option-2-bounding-box-and-filters). On the cautious approach, we could select |
I think matters specifically related to the Han unification problem (with CJK or other languages likewise) should be discussed in #2208. If or not we need separate fonts for the different language versions is of course relevant here. But please keep in mind that Mapnik support alone is not enough, we also need Carto support. |
Since #4606 we have been including a script to download the fonts we use and this way implicitly tell style users they can rely on that taking care of the fonts. Unfortunately, upstream sources of fonts are volatile and require maintainance of the download locations as well as font file naming (#5013, #4956). Our current font download script design is not very good for managing that.
This is a proposal how a more sustainable approach could look like. This is not meant to rule out smaller changes to the existing setup to fix acute issues but to provide a discussion basis for a more long term strategy how to develop this further.
Proposal
The main ideas are:
fonts.mss
(where the order of entries is crucial - see Use local copy of fonts #4606) - this way we would have a single location where to make changes to the fonts rather than two (fonts.mss
andget-fonts.sh
) in different languages.This is just a rough sketch of how this could look like, the details would need to be worked out of course. Discussion of those as well as of the proposal is welcome.
The text was updated successfully, but these errors were encountered: