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

Sample window font in Firefox (macOS) is blurry #226

Open
JCash opened this issue Jul 20, 2022 · 9 comments
Open

Sample window font in Firefox (macOS) is blurry #226

JCash opened this issue Jul 20, 2022 · 9 comments

Comments

@JCash
Copy link
Contributor

JCash commented Jul 20, 2022

Screenshot 2022-07-20 at 09 46 07

Screenshot 2022-07-20 at 10 29 56

The W and S are most visibly cut off.

I tried to verify the texture with the Spector.js extension, but it wouldn't run for me.
Although I expect it to be the shader code to be slightly off here.

@dwilliamson
Copy link
Collaborator

dwilliamson commented Jul 20, 2022

Yes, there's not much I can do about this at the moment beyond making the font and spacing bigger, consuming more space in the UI.

The font renderer needs to be a lot more sophisticated to match the browser.

Although there will likely be flaws in how the atlas is baked. I haven't spent much time on it.

@JCash
Copy link
Contributor Author

JCash commented Jul 20, 2022

What's confusing to me is that the header font looks a lot more crisp.
Is that the same font? The S's look diffferent to me, so I guess not?

@dwilliamson
Copy link
Collaborator

The header is rendered by the DOM, not Remotery's shaders.

@dwilliamson
Copy link
Collaborator

I think an immediate improvement could be had with a pre-generated font atlas.

Can you run this for me: https://lucide.github.io/Font-Atlas-Generator/

Use these properties:

  • Font: Fira Code
  • Font Size: 9

Do the letters in the atlas look better than they do in Remotery?

@dwilliamson
Copy link
Collaborator

In fact, it appears they have the same problem in that generator: you can't reliably generate letters as the amount of anti-aliasing varies depending on where the letter is rendered into the atlas. These are two of the sample letter positioned differently on the atlas:

image
image

What also seems to vary it is the width of the output rectangle: odd generates different to even.

I think for reliability for now, I'll need a custom-built atlas. Then later (much later) quality font rendering can be addressed.

@dwilliamson
Copy link
Collaborator

dwilliamson commented Jul 20, 2022

I might try this if I get time https://github.com/memononen/fontstash. I already use it on an internal UI project and it's pretty flawless.

@JCash
Copy link
Contributor Author

JCash commented Jul 21, 2022

Sorry, I couldn't get the font atlas generator to produce a Fira Code atlas (or Fira Sans of any kind).

Yes, if the atlas is problematic to start with, it sounds good to look into alternatives.

@dwilliamson
Copy link
Collaborator

@dwilliamson
Copy link
Collaborator

Rather than generating the atlas offline, we might find some clues on water-tight atlas generation from xterm.js:

Interestingly, it appears to render a quad per glyph, so is still quite a ways from being the most optimal. This may imply requirements of their atlas generation that we can't match.

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

2 participants