Closed richardhozak closed 2 days ago
Welcome, @richardhozak. If you could be a little more specific that'd be helpful. This will depend on which fonts you have installed, and how your FontConfig is set up. Which distro are you on, and which version of that distro? Also, does Arabic text normally display on your system, but not in this example?
I am on PopOS 22.04 I have not messed with FontConfig so it should be in default configuration. Arabic text renders in Firefox and I've also tested cosmic text, which also works FWIW. I looked into installed fonts and can see that there are arabic variants that are chosen in Firefox.
I've also tested swash_render example on Ubuntu 24.04 and it works there, I am not sure what could be different between those two systems.
I've investigated a bit more, tried default installation of PopOS 22.04 and Ubuntu 24.04 in VMs and can see that in Ubuntu 24.04 fontique correctly chooses fallback family "Noto Sans Arabic" but on PopOS 22.04 it figures out two fallback families: "Noto Sans" and "Noto Serif" both not being correct.
I've found the issue. For some reason fontconfig's lang map reports "Noto Sans" and "Noto Serif" as default families to use for Arabic even though we can find font families with better coverage.
Thanks for investigating this. We currently blindly trust fontconfig’s language mappings but it seems like we should do a minimal coverage check on those and trigger the fallback path if it fails.
I do have a fix you are describing, will publish PR later today, it got a bit late yesterday 😴...
Hello, I wanted to test out this library, so I've run the swash_render example on my system and the font fallback for arabic text does not work as expected.
Here is rendered swash_output.png from the example:
Is there anything I can test to debug this issue?