Open kekekeks opened 4 years ago
Also happens with CentOS 7 - https://github.com/AvaloniaUI/Avalonia/issues/3694
Could it be that the apps do not have access to the fonts? Can you load them manually via a path? Either the system fonts or a custom font?
Fonts are loadable via SkTypeface.FromFile
.
fc-match
command line utility is able to locate the font that corresponds to the "Sans" name.
Is this happening with just snap packages or always?
Someone had this issue on Manjaro without a container. Couldn't repro it with my local setup.
Another repro https://github.com/AvaloniaUI/Avalonia/issues/3701
I'll be looking at this soon, so just to get the cases together... It always happens with snap packages? And sometimes on various linux distros?
Has anyone tried looking at listing all the fonts installed? https://docs.microsoft.com/dotnet/api/skiasharp.skfontmanager.fontfamilies
var fonts = SKFontManager.FontFamilies.ToArray();
Console.WriteLine($"first font: {fonts[0]}");
If there are fonts then something is wonky with the lookup process. If there are no fonts, then for some reason fontconfig can't find anything at all.
My guess is that font matching isn't working. Some people have reported that SKTypeface.FromName(..)
is working if you specify the exact matching name of an installed font.
The SKTypeface.Default
translates to SKTypeface.FromName(null)
which is using font matching as well.
Maybe newer Fontconfig has changed in a way that breaks the SKFontmanagerImpl
It always happens with snap packages?
The first report with desktop Manjaro Linux (non-snap) was about a stack overflow in Avalonia code. We've identified that it was caused by SKTypeface.Default.FamilyName
being null
and that SKTypeface.FromFamilyName("Sans")
also fails while the rest of the desktop is working fine.
We couldn't reproduce it locally.
The second report was about the same symptoms with snap packaging which can be reproduced on any machine.
The last report is from desktop Debian 10 machine.
Not sure if this is related, but SKTypeface.Default.FamilyName
returns null
for me when using japanese. (LANG=ja_JP.UTF-8
).
Setting LANG
to C
solves the problem.
https://github.com/mono/SkiaSharp/issues/1131#issuecomment-583640278
in publish folder there is no .ttf file.
Description
We've had several reports about SKTypeface not loading fonts on Manjaro. Today we've had a case with a snap-packaged app that could be reproduced on any machine thanks to snapcraft container technology
Code
SKTypeface.Default.FamilyName
returnsnull
SKTypeface.FromFamilyName("Sans")
returnsnull
More details about the repro: https://github.com/AvaloniaUI/Avalonia/issues/3679