Closed sandsc closed 3 months ago
I, too, did you find a solution?
@sandsc You should add the font options in Kylin os:
appBuilder.With(new FontManagerOptions()
{
DefaultFamilyName = "Noto Sans CJK SC",
FontFallbacks =
[
new FontFallback { FontFamily = "文泉驿正黑" },
new FontFallback { FontFamily = "DejaVu Sans" },
],
});
I wrote the Chinese blog in https://blog.lindexi.com/post/dotnet-%E8%A7%A3%E5%86%B3-Avalonia-%E5%9C%A8-OpenKylin-%E9%BA%92%E9%BA%9F%E7%B3%BB%E7%BB%9F%E8%BF%90%E8%A1%8C%E6%89%BE%E4%B8%8D%E5%88%B0%E9%BB%98%E8%AE%A4%E5%AD%97%E4%BD%93%E5%90%AF%E5%8A%A8%E5%A4%B1%E8%B4%A5.html
@sandsc You should add the font options in Kylin os:
appBuilder.With(new FontManagerOptions() { DefaultFamilyName = "Noto Sans CJK SC", FontFallbacks = [ new FontFallback { FontFamily = "文泉驿正黑" }, new FontFallback { FontFamily = "DejaVu Sans" }, ], });
I wrote the Chinese blog in https://blog.lindexi.com/post/dotnet-%E8%A7%A3%E5%86%B3-Avalonia-%E5%9C%A8-OpenKylin-%E9%BA%92%E9%BA%9F%E7%B3%BB%E7%BB%9F%E8%BF%90%E8%A1%8C%E6%89%BE%E4%B8%8D%E5%88%B0%E9%BB%98%E8%AE%A4%E5%AD%97%E4%BD%93%E5%90%AF%E5%8A%A8%E5%A4%B1%E8%B4%A5.html
Thanks, I fixed this for now by using your method, but v11.0.x doesn't have this issue. Is this an API change or a bug?
If it worked before it should still work with newer Avalonia. But in the end there is nothing we can do if the FontManager isn't providing a default.
This is indeed a bug but the above workaround works.
Describe the bug
Gets InvalidOperation while app startup, It works on 11.0.x version.
To Reproduce
Create a default Avalonia app using Project template by using version 11.1.x, run it on linux, e.c. ubuntu or kylinOS v10.
Expected behavior
The app starts normally
Avalonia version
11.1.x
OS
Linux
Additional context
No response