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

blurry text? #184

Open
frogmoji opened this issue Nov 10, 2023 · 6 comments
Open

blurry text? #184

frogmoji opened this issue Nov 10, 2023 · 6 comments

Comments

@frogmoji
Copy link

i've noticed that the text goes blurry in places, and i'm not sure how to fix it. i don't think it's a problem with my coding, as it happens even with very basic text boxes. has anyone found a fix for this?
blurry text

@spencerflem
Copy link

spencerflem commented Dec 12, 2023

I've just gone through the same thing. This happens when the text does not start exactly at a pixel offset. Be careful about using center and padding in any unit other than pixels

@juanigaray
Copy link
Collaborator

@frogmoji Hi! Was spencerflem's answer useful? Do you think it would have been useful to have this problem documented?

@909oce
Copy link

909oce commented Feb 23, 2024

was a fix for this ever found? i use pixel padding but it still happens, sometimes it randomly goes from normal to blurry mid sentence.

@spencerflem
Copy link

was a fix for this ever found? i use pixel padding but it still happens, sometimes it randomly goes from normal to blurry mid sentence.

By chance are you viewing on a screen with the display scale set to > 100%? That's the other thing I've found that reliably causes blur, but its more hassle to compensate for

@909oce
Copy link

909oce commented Feb 24, 2024

was a fix for this ever found? i use pixel padding but it still happens, sometimes it randomly goes from normal to blurry mid sentence.

By chance are you viewing on a screen with the display scale set to > 100%? That's the other thing I've found that reliably causes blur, but its more hassle to compensate for

No it's set to 100%. The slight workaround I'm using is adding margins on text where its blurry between 0.1px and 0.5px. It ever so slightly shifts stuff into focus.

@Petally
Copy link

Petally commented Aug 31, 2024

This is to do with subpixel rendering of the font. Usually, subpixel rendering makes fonts look better, however, in pixel fonts it makes the font look way worse. I've found a hacky workaround. Apply this css rule to any text you have:

contain: paint;

This will make the font render in whole-pixel numbers... However, any descendants of the element with this rule will not be painted outside the element's boundaries.

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

5 participants