Hacker News new | ask | show | jobs
by p1necone 628 days ago
Isn't "what MacOS does" just shipping extremely high DPI screens on everything + using regular anti-aliasing on fonts with no hinting or subpixel rendering?
3 comments

I have Fedora Kinoite and Mbpr M1Pro connected to the same 4k Dell monitor. Font rendering is still much better on macos than any settings in Fedora.
Probably because MacOS doesn't do fractional scaling. If you're not using a scaling mode that's an integer multiple of your monitor resolution MacOS oversamples the whole display. Kinonite is KDE iirc which can do fractional scaling (quite well too) on KDE 6. So if you're comparing 1.5x scaling on KDE compared to MacOS you're actually comparing a 3840x2160 render to 5120x2880.
MacOS was doing fractional scaling long before KDE even began to implement it.

UPD: just to be clear - even on macbook's screen macOS uses scaled resolution by default.

MacOS always renders at an integer multiple of their internal "logical" resolution, and then just shrinks the framebuffer down at the end to whatever the native resolution of the target monitor is.

Fractional scaling is rendering directly to a framebuffer at the target monitors native resolution, and scaling your UI fractionally to look right on the target screen size.

Apples approach is more resource intensive, but probably makes UI layout implementation a lot simpler and more consistent + potentially looks better than rendering at "real" native res for a lot of content.

KDE got fractional rendering of fonts and UI back in Plasma 4.
I think you're right, I might've been confusing it with proper support for mixed DPI desktops (i.e. one display at 1.5, and another at 1x). I think Plasma 5 could do it but I had a lot of problems until Plasma 6.
Fractional scaling was introduced in late 5 update and wasn't touched in 6 at all, per-monitor setting is only in Wayland for an obvious reason.
Why would anyone do fractional scaling... why not just natively render at the proper resolution. (barring old broken apps).
Given a 4K monitor you have 3 options: - No scaling, produces tiny text and UI elements - 2x scaling, use a logically 1080p display leading to very large text and UI elements - 1.5x scaling, logically a 1440p display

4k at 1x produces UI that's too small, 2x scaling is too large for a 27 inch monitor. 1.5x sizes everything like a 1440p display but you still get the higher resolution rendering at 4k.

Fractional scaling _is_ rendering at the 'proper' resolution of the display. It can be challenging to workaround some issues like how to deal with window sizes that scale to a fractional native buffer (i.e. a 501 logical pixel wide image becomes 751.5 physical pixels?). Apple decides 'no' to native fractional scaling, so does GNOME unless that's changed recently.

> so does GNOME unless that's changed recently.

Which imo was a bad choice. It works pretty well on MacOS because Apple only ships machines with a fairly constrained, known set of resolution/physical dimension combos. And they sell their own monitors for stuff like the mac mini where that isn't the case. This means they can design all their UI elements to be the "right" size without needing fractional scaling for a very large percentage of their users.

Gnome is running on all sorts of screens, with all sorts of resolution/dimension combos and on a lot of them you have to choose between "way too big" and "way too small".

I believe GNOME just hides the option for fractional values in their native settings menu, but it can be easily accessed through something like GNOME tweaks and similar.
It's exactly for "old broken apps".

What I generally do on my Gnome systems running 4k screens is to use 125% or 150% scaling, and then set larger default fonts for the system. Fractional scaling helps keep old apps legible even if imperfect, but updated apps which respect system font size render great (Gtk+ widgets auto-scale to fit the text).

Unfortunately, this approach ain't gonna work with Wayland as well.

Wokring on a 4+k monitor without scaling is difficult (at least if we are talking about text)
Gnome has another set of hidden settings to set default system font sizes: for UI elements and "document" font. Some non-GNOME apps used to respect that too (like Firefox and LibreOffice), but others were not-scaled.

Still, if you mostly relied on Gtk+ apps, where Gtk+ widgets scale to fit the text they are showing, this produced pretty good results even if some spacing was a bit inconsistent (i.e. spacing was too small compared to widget and text sizes).

Unfortunately, this approach seems to work less and less well as Gnome devs are following Apple's lead.

KDE works the same.
That sounds exactly like what I do in Linux.
It’s probably what macOS does but they manage to do it cleanly whatever the display scaling you choose, including arbitrary values of scaling that are unsupported by the OS (but that you can force with some software).

On Linux, good luck using anything else than integer scaling. And it’s a shame because with a 4K screen and fractional scaling, you can get both more definition AND more real estate.