Creating a font like this should give the same result as new Font("JetBrainsMono", size, style) when it's installed on the system:
var asm = Assembly.GetExecutingAssembly();
var builtinFontFamily = FontFamily.FromStreams(asm.GetManifestResourceNames()
.Where(name => name.StartsWith("JetBrainsMono/"))
.Select(name => asm.GetManifestResourceStream(name)));
return new Font(builtinFontFamily, size, style);
Those embedded resources are .ttf files directly pulled from an installed font on macOS.
Actual Behavior
Some characters are sometimes missing. Weirdly this only seems to happen when rendering them directly in a Drawable. Label, etc. seem to work fine from testing with the example app.
Additionally it also sometimes crashes inside Eto.Drawing.Font.GetHashCode() by using a Font as a Dictionary key.
Note that this doesn't appear to happen on WPF or GTK.
Steps to Reproduce the Problem
Load font from stream
Use that font inside a drawable
Have it sometimes not render characters
Code that Demonstrates the Problem
This issue can be seen in my project: Celeste Studio (Note that after commit abefee a workaround with "Monaco" is used). Under Setting > Font... changing between the built-in JetBrainsMono and a system install of it, the issue should become obvious after a bit of scrolling. (Just paste this into it to get some file-content)
Expected Behavior
Creating a font like this should give the same result as
new Font("JetBrainsMono", size, style)
when it's installed on the system:Those embedded resources are .ttf files directly pulled from an installed font on macOS.
Actual Behavior
Some characters are sometimes missing. Weirdly this only seems to happen when rendering them directly in a
Drawable
.Label
, etc. seem to work fine from testing with the example app. Additionally it also sometimes crashes insideEto.Drawing.Font.GetHashCode()
by using aFont
as aDictionary
key. Note that this doesn't appear to happen on WPF or GTK.Steps to Reproduce the Problem
Code that Demonstrates the Problem
This issue can be seen in my project: Celeste Studio (Note that after commit
abefee
a workaround with "Monaco" is used). UnderSetting > Font...
changing between the built-in JetBrainsMono and a system install of it, the issue should become obvious after a bit of scrolling. (Just paste this into it to get some file-content)https://github.com/user-attachments/assets/7134ab1f-473c-438b-9af7-7ad161aa99ff
Specifications