Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mac: Font from stream is weirdly broken #2681

Open
psyGamer opened this issue Sep 3, 2024 · 0 comments
Open

Mac: Font from stream is weirdly broken #2681

psyGamer opened this issue Sep 3, 2024 · 0 comments

Comments

@psyGamer
Copy link
Contributor

psyGamer commented Sep 3, 2024

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:

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

  1. Load font from stream
  2. Use that font inside a drawable
  3. 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)

8mb.video-hzl-olNz9ujp.mp4

Specifications

  • Version: 2.8.4-ci-20240710.9879198421
  • Platform(s): Mac64
  • Operating System(s): macOS 10.15.7 and 14.6.1 (the crash has so far only been observed on this version, but the rendering issues on both)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant