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

anti-aliasing suggestion #125

Closed
nathnolt opened this issue Apr 10, 2022 · 7 comments
Closed

anti-aliasing suggestion #125

nathnolt opened this issue Apr 10, 2022 · 7 comments

Comments

@nathnolt
Copy link

It's actually possible to remove anti-alias, although it can screw the text up if you zoom in.

https://stackoverflow.com/a/66657150/3082553

DEMO: https://codepen.io/nathnolt/pen/mdpKBoN

@hollowmage
Copy link

hollowmage commented Apr 21, 2022 via email

@nathnolt
Copy link
Author

I'm sorry but I don't see the attachment.

@hollowmage
Copy link

Screenshot_20220421-094920
I guess this doesn't work with email, here you go

@nathnolt
Copy link
Author

Yeah, it's zoomed to a different level. I think that android does either by default, or from the meta viewport ( ) code. This probably could be fixed. But yeah, the solution is quite hacky. For all the browsers. like if you zoom in with Chrome, using ctrl+scroll it also will look bad in the same way.

@1j01
Copy link

1j01 commented Feb 15, 2023

I forked the codepen and tested longer runs of text, found it became ugly (as expected), but also found a preliminary solution for that, adjusting word-spacing. (I don't know if letter-spacing would be more appropriate, and I didn't play around with word-spacing values because my tweak actually worked right away, surprisingly!) I would hope that there's some metric in the font itself that's inaccurate and can be modified to fix the drift, but, if I look at Firefox, it doesn't want the word-spacing tweak, only Chrome wants the word-spacing tweak.

I also provided a (partial) solution for the ugly zoomed text. You can use media queries to detect the device pixel ratio, and apply the filter only if it's 1. This also lets you swap out the font with a non-pixelated version, if desired. Obviously this doesn't give you a nice pixelated font when zoomed in (or on all devices), but it can prevent the filter from degrading the experience (except in some inevitable exceptional cases.)

The low down is that this could kind of work, but it will need an adjustment dialog like Windows's ClearType.
And this will still run into problems with centered text, and nesting in various layouts.

@nathnolt
Copy link
Author

I think that the only way to make it work consistently, is to change the entire codebase to only allow scaling values of integers, either for everything, or for just the text. This is most likely outside of the scope of 98.css, but maybe something like this could be inside of the scope of a classic windowing library using JS.

@juanigaray
Copy link
Collaborator

I'm gonna close this discussion as stale but please feel free to submit a PR if you believe you have a fix for at least some cases.

@juanigaray juanigaray closed this as not planned Won't fix, can't repro, duplicate, stale Sep 20, 2023
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

4 participants