Open hrydgard opened 8 months ago
You could make a pr to fontdb to add this folder
Right, I suppose this issue belongs more in the fontdb repo, although the fallback code is in the cosmic-text repo: https://github.com/pop-os/cosmic-text/tree/main/src/font/fallback
Yes, there may need to be custom fallback code in cosmic-text, but the system font directories should be added in fontdb so other projects using it find the fonts as well.
On Android, cosmic-text will crash by default since it doesn't find any fonts. Once you do add fonts though, it works just fine, which is great.
On every Android device, a set of default fonts is located in
/system/fonts
, which is user-readable. This does not appear to be documented by the Android project officially anywhere - nevertheless, it's a fact that you'll find these fonts in that folder on every device, and there surely are lots of apps out there that depend on this.Here's all I needed to do to get basic font families to work on Android (although there might also be some work to be done with fallbacks):
If the project doesn't want to add this, at least this Github issue will now be searchable to find this workaround.
I'm not sure exactly how to set up the CJK fallback fonts, though. I've logged the info about the found faces from a PocoPhone F1 here.