Live data from Hacker News

Fractional scales, fonts and hinting

blog.gtk.org

61–70 of 117 posts

Re: Fractional scales, fonts and hinting

#61
post #25

Honestly I'd love it if Linux just implemented a solution similar to what Apple does, which is rendering everything at 2x and then downscaling it to screen's native resolution. (So my "3008x1692" on a 4K screen is actually rendered at 6016x3384). Modern GPUs are strong enough to do this without breaking a sweat, and the result is very crispy and functional. Fractional scaling could still exist as a fallback for older…

That's what GTK used to do. The result looks much worse than fractional scaling, is much less crisp, uses a lot more battery, and means games run a lot slower.

Re: Fractional scales, fonts and hinting

#62
I wonder if we'll ever abandon resolution-based rendering for screens, instead using a PPI/DPI vector-based system?

Since the 80s I've been wishing for a 300/600dpi resolution-independent screen. Sure, it's basically like wishing for a magic pony, but I was spoiled by getting a Vectrex[1] for a birthday in the 80s, and I really liked the concept. I know the Vectrex was a different type of rendering to the screens we use today, but I still find it fascinating.

[1] https://en.wikipedia.org/wiki/Vectrex

Re: Fractional scales, fonts and hinting

#63
post #29

I'm curious - when you were doing research into the mechanics of hinting options, did you stumble onto any relevant discussion around allowing custom pixel geometries to be defined, to enable hinting on modern OLED / WRBG displays? There's a good thread on the topic here[0], with some people referring to it as 'ClearType 2' on the MS side [1]. On the oss side I know FreeType theoretically supports this[2], but I can'…

AIUI the trend has been towards GUI frameworks dropping support for subpixel AA altogether, since that simplifies so many things[1], so I'm not holding my breath for the current limitations around unusual subpixel layouts being fully resolved on any platform. Apple made the switch to greyscale-only AA years ago, Microsoft is mid-transition with their newer GUI toolkits ignoring the system Cleartype setting and always…

Even on a screen with not-particularly-high DPI, grayscale AA is fine. Subpixel AA was a brilliant idea for the displays of 2005 (72-96 DPI), but it came with lots of downsides (like color fringing on dark backgrounds, or for users with astigmatism). Grayscale AA drops both the benefits and the drawbacks, but even at like 100 DPI, the difference is very marginal.

Re: Fractional scales, fonts and hinting

#64
post #29

Earlier quoted context omitted.

AIUI the trend has been towards GUI frameworks dropping support for subpixel AA altogether, since that simplifies so many things[1], so I'm not holding my breath for the current limitations around unusual subpixel layouts being fully resolved on any platform. Apple made the switch to greyscale-only AA years ago, Microsoft is mid-transition with their newer GUI toolkits ignoring the system Cleartype setting and always…

Even on a screen with not-particularly-high DPI, grayscale AA is fine. Subpixel AA was a brilliant idea for the displays of 2005 (72-96 DPI), but it came with lots of downsides (like color fringing on dark backgrounds, or for users with astigmatism). Grayscale AA drops both the benefits and the drawbacks, but even at like 100 DPI, the difference is very marginal.

Color fringing on dark backgrounds is yet another artifact of anti-aliasing being done with a misconfigured gamma. Regardless you can configure subpixel rendering to minimize these fringing effects.

Re: Fractional scales, fonts and hinting

#65

Earlier quoted context omitted.

i always disliked hinting aswell, but thankfully one can just disable hinting on linux, and then fonts actually look fairly similar to what osx did(~10-15 years ago)

Full hinting is a must-have if you turn AA off and use fonts that were designed to be hinted to a pixel grid. Fonts have several distinct periods where they were designed expecting that renderers would function a certain way. File format notwithstanding, one size does not fit all. You really do need to match your font to your renderer's settings.

You can also match your renderer's settings to your font, and have it different for different fonts, via fontconfig. But actually using that is pretty advanced.

Re: Fractional scales, fonts and hinting

#66

For some reason, FreeType broke proper grid-fitting and now requires environment variable FREETYPE_PROPERTIES=truetype:interpreter-version=35 to activate it.

It's not quite right to say it broke proper grid-fitting, because that depends on what the fonts were designed and hinted for. The old one matches Windows 98 hinting (and therefore that era's core fonts), and the new one matches ClearType's hinting (and therefore that era's core fonts).

Re: Fractional scales, fonts and hinting

#67
And still no proper gamma correction.. wich makes the whole thing useless, specially on low-DPI screens

Nobody does it properly on linux, despite freetype's recommendations.. a shame..

https://freetype.org/freetype2/docs/hinting/text-rendering-g...

It's even worse for Light text on Dark backgrounds.. text becomes hard to read..

GTK is not alone

Chromium/Electron tries but is wrong 1.2 instead of 1.8, and doesn't do gamma correction on grayscale text

https://chromium-review.googlesource.com/c/chromium/src/+/53...

Firefox, just like Chromium is using Skia, so is using proper default values but ignores it for grayscale text too..

https://bugzilla.mozilla.org/show_bug.cgi?id=1882758

A trick that i use to make things a little bit better:

In your .profile:

    export FREETYPE_PROPERTIES="cff:no-stem-darkening=0 autofitter:no-stem-darkening=0 type1:no-stem-darkening=0 t1cid:no-stem-darkening=0"

Re: Fractional scales, fonts and hinting

#68

I wonder if we'll ever abandon resolution-based rendering for screens, instead using a PPI/DPI vector-based system? Since the 80s I've been wishing for a 300/600dpi resolution-independent screen. Sure, it's basically like wishing for a magic pony, but I was spoiled by getting a Vectrex[1] for a birthday in the 80s, and I really liked the concept. I know the Vectrex was a different type of rendering to the screens we…

I wish for this too. You can get tiny screens with that kind of pixel density. My ebook reader is 300ppi and my phone is almost 650ppi!

It saddens me when I see people measuring things in pixels. It should all be measured relative to the font or perhaps the viewport size. The font size itself should just be how big the user wants the text which in turn will depend on the user's eyes and viewing distance etc. The size in pixels is irrelevant but is calculated using the monitor's PPI. Instead we get people setting font sizes in pixels then having to do silly tricks like scaling to turn that into the "real" size in pixels. Sigh...

Re: Fractional scales, fonts and hinting

#69
post #4

These are good news! I think this was a tough ride for the Gtk developers. Thanks! Background: https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/6190 Basically gtk-hint-font-metrics=1 was needed with Gtk4 on non-HiDPI displays to get crisp text. Thanks to the change from 6190 above it is already automatically applied, when appropriate depending on which display is used. Mixed setups with multiple displays are commo…

> Apple avoids trouble and work by always using HiDPI displays. Attach a MacMini to a non-HiDPI display and you could recognize that the font rendering is awkward. You may personally find the output awkward, but typographers will disagree. They didn't always have high density displays. They did always have superior type rendering, with output more closely matching the underlying design. Hinting was used, but they did…

[deleted]

Re: Fractional scales, fonts and hinting

#70

Earlier quoted context omitted.

i always disliked hinting aswell, but thankfully one can just disable hinting on linux, and then fonts actually look fairly similar to what osx did(~10-15 years ago)

Full hinting is a must-have if you turn AA off and use fonts that were designed to be hinted to a pixel grid. Fonts have several distinct periods where they were designed expecting that renderers would function a certain way. File format notwithstanding, one size does not fit all. You really do need to match your font to your renderer's settings.

that may well be, but for me, I choose no hinting, with AA activated, and if a font does not look good, I simply do not use it.

IF i specifically REALLY wanted a font that required hinting to look good, I would make a special config for that particular font, but I would need some serious advantage to bother doing that

Post reply on HN