Hacker News new | ask | show | jobs
by chess_buster 1173 days ago
macOS Ventura 13.2.1 Safari Version 16.3 (18614.4.6.1.6) Dell 3840x2160 scaled to 2560x1440
1 comments

Thank you. So my guess is the 1.5 display scaling plays a role here— there is a penalty to that, since it's not mapping pixels 1:1.[1] So macOS has to do some kind of anti-aliasing?

I'm of course not the first to find out,[2] but it's probably not advisable to try to make raster fonts work as webfonts nowadays. There is no reliable way to disable anti-aliasing. Even if there were, one would be very limited in terms of type sizes, which becomes moot because of displays running with odd scaling… and so on.

[1]: https://appleinsider.com/inside/macos/tips/what-is-display-s...

[2]: https://github.com/jdan/98.css/issues/125

You can get the device pixel ratio from JavaScript using Window.devicePixelRatio. Maybe you can then add this as a css-variable to the body element and query it later on to compute a size for the fonts so they can match the "native" size of the pixels, for example using ggt.

[1] https://developer.mozilla.org/en-US/docs/Web/API/Window/devi...