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

Text is "fuzzy" #10

Open
Perksey opened this issue Jun 3, 2020 · 1 comment
Open

Text is "fuzzy" #10

Perksey opened this issue Jun 3, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@Perksey
Copy link

Perksey commented Jun 3, 2020

Currently, I'm working on a relatively retro project. As such, i'm trying to make the text look as retro as possible and part of that is making sure the edges of the text aren't "fuzzy" and is as pixelated as possible. Take this text for example:

image

You can see by zooming in that the lines aren't sharp - I expected the only colour in the rendered text to be white and the edges not to be blurred.

image

Is there any way to remove this fuzzy effect?

@drjaydenm
Copy link
Owner

Hi @Perksey, these "coloured pixels" are part of the text rendering algorithm that I adapted from Evan Wallace's post here. I would take a read of the bottom part of his post that describes the sub-pixel anti-aliasing approach used, it details why this is the case. In most cases it will give a nice result, but for the pixel perfect "crisp" case you are looking for, it may be better to not anti-alias (this may result in poor quality text at small font or screen sizes).

If you are wanting to disable the anti-aliasing, it should be possible by not performing the jitter pass, or at least only doing a single pass with no offset. You can see the code performing that here on line 278.
I probably won't be able to get around to this soon myself, but please feel free to pull the source down and play around with it. If you get it working nicely, feel free to let me know and I'll see if I can incorporate it back into this library.

@drjaydenm drjaydenm added the enhancement New feature or request label Jun 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants