-
-
Notifications
You must be signed in to change notification settings - Fork 51
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
Font missing CJK character glyphs #57
Comments
Editing for visibility The way the Fyne UI framework's text handling works, it is currently impossible to support all Unicode scripts at the same time because only two fonts can be loaded - 1 supplied by the app, and another that is built into Fyne. It is on the roadmap for Fyne to be able to use OS fonts to support all common Unicode scripts in version 2.5.0 of the toolkit. A workaround until then is to set a custom font in the Settings > Experimental window, that covers the missing glyphs for the most common non-Latin script music in your collection (e.g. if you have a lot of Japanese music, set a Japanese font as your custom font). The builtin Fyne font will be used to display any glyphs that are not present in the custom font you set but are in the builtin one. original comment: Can you copy and paste that artist name here? My guess is that it's not an encoding issue but that the default font that ships with the Fyne toolkit doesn't have the glyphs to display the characters. In which case switching out the font should solve it. (I plan to expose a UI for this once I add a settings screen, but for now you could try setting the FYNE_FONT environment variable to point to a .ttf font that supports the characters.) |
Also, if anyone has a suggestion for a better .ttf font to ship as the default for the app, please let me know! Ideally one that fully supports the Latin (with all diacritics) and Cyrillic alphabets, and all common CJK characters. Also it needs to have a compatible license to allow me to bundle it with the app. |
@dweymouth |
I will test this on my end but I'm pretty sure it's that the default Fyne font doesn't support CJK. I just did some quick googling and I haven't found an open source .ttf font that supports all of the common CJK characters in one font, so I probably need a UI for the user to set their own font. If they have a lot of Chinese music, setting a Simplified or Traditional Chinese font, likewise for Japanese, etc. I don't think all can be supported with one default font. But I'd love to be proven wrong! |
It seems that Fyne is working on supporting .ttc font collections. Once this lands I can use the Noto Sans family which should support most common Unicode characters across multiple alphabets. |
Also missing Thai, Hebrew and Arabic as well sample texts:
|
I am waiting for this issue (.ttc and/or .otc support) to be resolved in the Fyne project after which I plan on bundling the Noto Sans font family to cover pretty much all of Unicode. In the meantime setting the FYNE_FONT environment variable to the path to a .ttf file that includes glyphs for the script(s) you need rendered is a workaround. (Though I haven't really tested this.) |
Added experimental support for setting a custom application font via the settings dialog (#63) which will be in the next release. Still not an ideal solution as Supersonic should be able to support most common Unicode scripts by default - but this is not currently possible with Fyne's font handling. It is in their roadmap though. |
For anyone passing by looking for a solution, I've found that Go Noto Universal (specifically GoNotoCurrent.ttf) seems to do the job well. |
Yep, and I even thought about bundling that font with the app, but the text handling isn't really optimized for huge fonts and when I tested it, it increased RAM use by a decent bit as well as the startup time (and obviously app package size), so I didn't want to force it on everyone whose collections only needs Latin scripts. |
Just tried it with |
Just tried it and it works. Increases memory usage from about 230mb or so to 460mb. I can now understand why fonts that support everything are uncommon and rarely used, but if the pc is strong enough this is a small trade off for fixed fonts. SMALL UPDATE: |
The good news is the work to load OS fonts as needed is almost complete in the Fyne toolkit and it will be in their next release in a few months. It's possible I might be able to pull it over early too, but it depends on how maintainable it is on its own separated from the other recent Fyne developments. |
The text was updated successfully, but these errors were encountered: