Custom fonts not working
See original GitHub issueHey, I’m having trouble getting custom fonts to work on Avalonia. I have a <TextBlock FontFamily="/Assets/dos.ttf#PerfectDOSVGA437">test</TextBlock>
control in the XAML, the text is displayed in the fallback font instead of the specified one. System fonts work as expected though
This is the font I’m using, but I’ve tried others with no success
I’m thinking it could be a Linux issue since someone else tried the same thing on Windows and the text displayed correctly there
Anyone knows what could be causing this?
Issue Analytics
- State:
- Created 3 years ago
- Comments:27 (12 by maintainers)
Top Results From Across the Web
Using custom @font-face in CSS is not working in any ...
It turns out that I was using the "Files\Fonts\" as the path of the font, although since it was the css file I...
Read more >Custom Fonts Not Displaying On Front End
If your custom font is not showing and you receive a CORS error in your browser's console, you need to contact your host,...
Read more >css - Custom font not loading
Ok here is how it should work. and the fonts Folder should be located in the CSS folder. Also, remove your forward slashes...
Read more >Custom font is not working.
Hi :] I am trying to put a custom font in my localhost site child theme. So Iv'e created the 'fonts' folder within...
Read more >How To Load and Use Custom Fonts with CSS
You can use the @font-face rule to load a custom font on a web page. The history of loading custom fonts has lead...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@Gillibald just for your information. It would be more friendly to have a list of available fonts in the exception message:
... Avalonia.Skia.dll: 'Could not create glyph typeface for: My Font. Available fonts: Font One, Font Two ..
.I’ve returned all my fonts to EmbededResourses and to
<FontFamily x:Key="MyFont">resm:My.Lib.Assets.Fonts.MyFont-Medium.ttf?assembly=My.Lib#Fira Code"</FontFamily>
And added debug output for my resources:foreach (var res in assembly.GetManifestResourceNames()) Debug.WriteLine("found resource: " + res);
the output is:found resource: My.Lib.Assets.Fonts.MyFont-Medium.ttf found resource: !AvaloniaResources
It works almost but on showing a ToolTip. On Windows it just doesn’t show a tooltip on Mac it crushes with the Exception:... Avalonia.Skia.dll: 'Could not create glyph typeface for: My Font.' at Avalonia.Skia.FontManagerImpl.CreateGlyphTypeface(Typeface typeface) in /_/src/Skia/Avalonia.Skia/FontManagerImpl.cs:line 139 ...