-
Notifications
You must be signed in to change notification settings - Fork 34
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
Generate glyphs for any font from google/fonts #1
Comments
I have currently got the glyphs generating for all https://github.com/google/fonts typefaces locally It'll generate all fonts in ~25mins which is ok for circle CI to automate. However the size is about 2Gb which mean's we'll have to pick just a few typefaces to start off with until I get somewhere else to deploy to other that github pages (AWS probably)
|
All fonts (or subset of) are now generating locally. We now need to provide fallback typeface generation. Currently styles (osm-liberty for example) load a set of glyphs from the font store. These are stored by key including their fallback. So for example
We currently only have Roboto in our rendered glyphs, which in turn doesn't support Chinese, Japanese or Korean (CJK). So osm-liberty doesn't currently render those glyphs. To fix this we need to create This can be done by simply merging the PBF files in the font-stack order. |
An example is up at orangemug/font-glyphs-v2 (temporary repo) Demo: https://orangemug.github.io/font-glyphs-v2/example/#4.15/47.656/1.316 CC @lukasmartinelli you might be interested in using the font index (or something like this) for font selection in maputnik/editor |
Dude that is awesome!! Such a great idea with the repo and font index. |
Not yet but hopefully it will be, so the ultimate aim of this repo is to be able to use any google font falling back through the recommended stack from google fonts. Problem is at the moment is they tend to get kinda large with CJK, you can see that from the klokantech repo
Additionally I plan to add what code point ranges it supports to the |
First attempt at a unicode range coverage report: https://orangemug.github.io/font-glyphs-v2/reports/char-table.html Warning: 20mb it a HTML file Updated: Font report https://orangemug.github.io/font-glyphs-v2/reports/char-table.html with noto-cjk and noto-emoji |
Update: orangemug/font-glyphs-v2 now allows for any font from google fonts to be generated. It also implements and index.json file as described above orangemug/font-glyphs-v2 tracks the v2 branch in this repo. Due to some changes in font names to better match google-fonts, this would cause a breaking change to osm-liberty. We will raise a PR pre merge of v2 branch |
Hi! the https://orangemug.github.io/font-glyphs-v2/reports/char-table.html is damn cool! I also love the While working on OpenMapTiles (the OSM2VectorTiles follower) - we made a basic catalog of fonts used in the open map styles and also downloadable individually from a mobile app or tileserver deploy. See: https://github.com/openmaptiles/fonts This allows us to run a preview of the GL Styles on Github with Travis like: This is documented at: Any improvements or pull request towards this would be great. It would be also great to filter from KlokanTech Noto the glyphs not available in Arial Unicode. |
Hey @klokan thanks! I'll take a look more into this later in the week. I'll explain my aims of this project a little
Basically I want to explore typography in maps, and I want the service to give all the information needed to make the right decision for a particular context in terms of typography. If this repo can be useful for your (and @lukasmartinelli's) grand web mapping plan :) please let me know. I'm more than happy to add you as contributors, and even change ownership of the repo if thats helpful. Anyway this ticket has gone way off topic (my fault... oops), hope this is helpful |
These are great goals! I am really keen to sync, so we don't duplicate the effort - esp. the font catalog for Maputnik styling seems a shared goal. You have really amazing results on the font content analyze here. BTW your point two (fallback fonts / combined font stacks) - is already implemented inside of https://github.com/klokantech/tileserver-gl - feel free to check the source code. @lukasmartinelli could you comment (or create a separate ticket on maputnik) about the requirements on index.json for fonts? |
Well that's a lot better than what I had planned
This seems like a plan, looks like I need to do some reading to see where I can be useful. I don't have a lot of time, but if I can be helpful towards openmaptiles / maputnik I'll do what I can. |
Just for reference - to have it in this ticket (which can be closed probably) We have made a font catalog at: List of the fonts is exposed to Maputnik via /fonts.json. See discussion at: A simple version of the font service (without combined fonts) can be served directly from GitHub gh-pages and can be static. For font concatenation, the TileServer GL or TileServer GL Light installation is the most straightforward. |
Hey @klokan unless I misunderstand openmaptiles doesn't really aim to cover what this ticket describes. This ticket aims to generate any google font via CI, something which currently works in v2. I'll aim to get back to this over the coming months. The idea is that rather than relying on a service to generate font stacks you can just do it yourself with a free github account and a circle CI service. However I'll add https://github.com/openmaptiles/fonts/ to the README because it's currently a better alternative. On that note someone should probably create a PR for https://github.com/lukasmartinelli/osm-liberty/blob/gh-pages/style.json#L23 |
Also @klokan to add, the initial problem for which this repo was created. When @lukasmartinelli originally generated the glyphs for osm-liberty there was an issue and the glyphs had gaps in the ranges. Using a SHA (submodule) of the font and a recipe (script) to generate the glyphs meant I now know where the glyphs are coming from and how they are generated. If there are issues it's easier to track them down. This was a design decision which may be a consideration for openmaptiles/fonts |
Generate glyphs for any google font mounting an index in the base directory
Where the index file would look like
The idea being that app can load the
index.json
and have access to glyphs for all the typefaces.The text was updated successfully, but these errors were encountered: