Skip to content
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

Closed
vbabiy opened this issue Mar 2, 2023 · 13 comments · Fixed by #389
Closed

Font missing CJK character glyphs #57

vbabiy opened this issue Mar 2, 2023 · 13 comments · Fixed by #389
Labels
has-workaround A bug that has a viable workaround
Milestone

Comments

@vbabiy
Copy link

vbabiy commented Mar 2, 2023

image

@dweymouth
Copy link
Owner

dweymouth commented Mar 2, 2023

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.)

@dweymouth
Copy link
Owner

dweymouth commented Mar 2, 2023

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.

@vbabiy
Copy link
Author

vbabiy commented Mar 2, 2023

@dweymouth 陈致逸 & HOYO-MiX

@dweymouth
Copy link
Owner

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!

@dweymouth dweymouth changed the title Title Encoding issue Font missing character glyphs Mar 3, 2023
@dweymouth dweymouth changed the title Font missing character glyphs Font missing CJK character glyphs Mar 3, 2023
@dweymouth
Copy link
Owner

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.

@kahnwong
Copy link

Also missing Thai, Hebrew and Arabic as well

sample texts:

רבע לשש - Hebrew
انا انا وانت انت - Arabic
นันทิดา แก้วบัวสาย - Thai

@dweymouth
Copy link
Owner

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.)

@dweymouth
Copy link
Owner

dweymouth commented Apr 22, 2023

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.

@dweymouth dweymouth added the has-workaround A bug that has a viable workaround label Apr 22, 2023
@dweymouth dweymouth pinned this issue Jul 15, 2023
@inalone
Copy link

inalone commented Jul 25, 2023

For anyone passing by looking for a solution, I've found that Go Noto Universal (specifically GoNotoCurrent.ttf) seems to do the job well.

@dweymouth
Copy link
Owner

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.

@Merkwurdichliebe
Copy link

Just tried it with Go Noto Current-Regular. Please note that although Hebrew and Arabic characters are indeed displayed with this font, all strings are in reverse order (since both are RTL languages). On the Navidrome web interface all scripts are shown correctly and without errors. Thanks for looking into it.

@CatWithCode
Copy link

CatWithCode commented Apr 15, 2024

For anyone passing by looking for a solution, I've found that Go Noto Universal (specifically GoNotoCurrent.ttf) seems to do the job well.

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:
If you load a large list of titles, even on a powerful system, the CPU usage will increase significantly and rendering will slow down a lot. You may not want to use this if you have very large lists.

@dweymouth
Copy link
Owner

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.

@dweymouth dweymouth added this to the 0.11.0 milestone May 23, 2024
@dweymouth dweymouth linked a pull request May 25, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
has-workaround A bug that has a viable workaround
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants