Source Arabic font from CDN, newer repo
As discussed in #4893, Google stopped updating our go-to fonts repo https://github.com/notofonts/noto-fonts two years ago. They now distribute multilingual Noto through individual repos, the jsdelivr CDN, and GitHub Pages.
In #5052 we added a Python script to download fonts. For now I suggest a separate list of fonts to download from the new sources (NEWER_REPO). As written this would work for most fonts, though there are exceptions (such as the UI fonts and NotoSansKayahLi) which were handled in #4893.
I'd like to update Arabic first here to fix a known issue in Kurdish map labels. I checked with a maintainer in the Noto Arabic repo, and "Arabic UI" is no longer updated; we also want to switch over to the standard font.
I am wondering if maintenance wise it is good to implement the path name logic (which is non-standardized and can change at any moment because someone feels the urge to scratch an itch) in script or if it is better to maintain a list of literal URLs or format strings.
This is ultimately something to decide when implementing point 3 on #5043.
Relevant thread on Arabic and line height from 2016, which helped select the Arabic UI font (which unfortunately got discontinued) https://github.com/gravitystorm/openstreetmap-carto/issues/2485 Also I see the current Noto Sans is a variable font but only for width and weight 😬 .
Yes, i remember the issue back then. Any suggestion how to proceed here? I don't really think we would want a massive labeling quality regression in regions with Arabic names. But i also can see that there are changes in the font from the UI variant to the newer non-UI variant used by this PR that are probably desirable to have. In the shown sample there is for example the road label with the شارع - which looks much better with the new font.
Two ideas, which would both be unusual for the repo so IDK what to suggest:
- switch to IBM Plex Sans Arabic, which has lesser line height, renders ڵا correctly, and is also SIL Open Font License
- rebuilding or somehow capping line height of Noto Arabic labels in renderer
Edit: comparing fonts on ڵا and شارع ; clicking through you can see multiline examples https://fonts.google.com/?preview.text=%20.%D8%B4%D8%A7%D8%B1%D8%B9%0A%DA%B5%D8%A7%20&lang=ar_Arab&query=sans
My very superficial impression is that IBM Plex Sans Arabic is quite different from Noto and seems much less clear to read at small font sizes. But this is definitely something where input from map users from regions using Arabic script would be helpful.
In general i am open to unusual options if it helps us continuing to provide a map that works well for the different scripts used in labeling. But of course we have to also look at maintainability of whatever we decide to do.
OK, I had a chance to dig into the Noto Arabic .glyph files, and I have patched the UI font which we've been using. This affects at least four ligatures which show up "U-shaped" in the current font. Demo: https://mapmeld.com/arabic/index.html
We still didn't update any languages to the newer Noto URLs, but that code remains available in the Python script
I'm hardcoding the URL to my GitHub repo / raw file. The 'more correct' way would be to download from my GitHub Pages (mapmeld.com/arabic/...), or I could also see finding a more consistent way to archive these (posting as a tagged release on the repo?)
- This change can't easily be merged back into the Noto repo because it would need to support condensed/semibold variable fonts
- This would affect about 1,000 place names currently on the map
OSM has added vector layers which use mapbox/mapbox-gl-rtl-text to do text-shaping on Arabic, unfortunately there is no single Unicode glyph for ڵا so it is still unsupported.
I'm open to reducing the changes here to just the Arabic font