Replies: 1 comment 3 replies
-
How do you ensure that the necessary fonts are present on the system? Maybe you could introduce multiple font packages like: https://github.com/AvaloniaUI/Avalonia/blob/master/src/Avalonia.Fonts.Inter/InterFontCollection.cs Adding and removing collection works at runtime as long as fonts are loaded before they are referenced. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm working on a program that runs on embedded Linux and supports multiple languages. I want to use different fonts for different languages, but I don't want to store all the font files as AvaloniaResources, which would significantly increase the size of the program.
The font files for all the different languages I use total nearly 1GB, which is daunting.
Thus, I'm thinking of dynamically loading font files based on the current language. My program also supports dynamic language switching (without restarting the program).
So, I'm looking for a way to dynamically load local fonts, including unloading them after loading (to avoid unnecessary memory usage when switching languages).
However, I only found this discussion:
#13563
This discussion is very long and fragmented, and I can't piece together the individual responses. I'm also unsure if it meets my needs, nor am I sure the latest version of Avalonia includes an API that makes it easier to achieve my needs.
My idea is to check whether there is a font for the corresponding language before switching to a different language. If not, download it online or ask the user to provide the font file. This can minimize the size of the program.
So, I'm raising this discussion to learn how this can be achieved.
Beta Was this translation helpful? Give feedback.
All reactions