170 points · by aswinmohanme · 6y ago · 158 comments
Edit: Headline's been changed, it was "Get macOS like font rendering on Linux"
Edit: just to clarify I'm not bashing Linux, more my usecase.
As far as I know, shortcuts are already pretty much global. Keyboard navigation, copy/paste, open/close/save, it all pretty much follows the same Windows standards. It takes time to learn to use all the shortcuts though, and a lot of them aren't intuitive. I've had the same experience when I tried macOS, none of the shortcuts made sense and behaviour was often non-intuitive coming from a non-Apple platform.
If you're happy with macOS you should totally stick with macOS, but luckily there's people working hard on solving the most glaring issues with modern UIs. Once trackpad support improves, a lot of people might feel a lot better at home than they do right now.
Word and like jumps in Windows also felt backwards to me, doing the equivalent of w instead of e in vim, and couldn't be consistently combined with shift.
Support for Alt+Dpad(+Shift) and Command+Dpad(+Shift) is important IMO. As well as Double/Triple-click+Drag: it should select additional units not letters.
These last paragraphs are OS-level but the features were missing or inconsistent.
I just tried this in macOS (Catalina), in Chrome while I happened to be looking at a design page in figma.com and nothing happened.
Not so surefire I guess. To be fair - I assume the web page was capturing that shortcut. It worked on the new tab page.
The point though is that this is an app thing, not a macOS thing. If every app on Windows and Linux decided to use the same exact shortcut for opening preferences, then we'd have that. On macOS, Apple does not strictly enforce Cmd+, for opening preferences - any macOS app can use that for whatever they want.
> Word and like jumps in Windows also felt backwards to me...
Jumping words is done with Ctrl+left/right arrow in Windows and Linux. On macOS it's Option+left/right arrow. On all systems, it can be combined with Shift to highlight the word.
> Support for Alt+Dpad(+Shift) and Command+Dpad(+Shift) is important IMO. As well as Double/Triple-click+Drag: it should select additional units not letters.
Not sure what this means, but on my Linux desktops I have absolute freedom to make my keyboard and mouse to do just about anything I can dream of. Meanwhile, in macOS I am often told that if I am not loving the way that Apple has chosen for me to behave, then I must be expecting the wrong thing...
This is why I don't use Linux on the desktop. (About half of my servers are Linux.)
Every couple of years I'll bring out my old HP laptop and spend most of a week installing all the newest desktop environments to see how they've progressed. I'm always disappointed.
I've been counting on Linux to be the big disruptor for two decades now. But more and more it's just becoming the poor man's Windows, by aping Windows conventions.
If I want Windows, I'll run Windows. If I want macOS, I'll run macOS. What I want is something different, not something that tries to be a watered-down version of both.
In 2009ish I had a ui where you could zoom out to a giant wall and rearrange all the windows on your virtual desktops and use a macish expose to bound to a mouse key to pick from the windows on the current desktop. The visual metaphor was better than macs and windows and to boot there were so many knobs you could tweak virtually anything.
Tiling window managers like i3wm and 17 more are both minimal and powerful. Notably i3 has MUCH more powerful keybindings and treats individual monitors as virtual desktops.
With xmonad your window manager is a haskell program with awesome a lua one.
If you want to go all in on emacs you can make it your window manager too.
Honestly its only windows lite if you want it to be so and really everyone is basically xerox lite to some degree or another because we are basically using the same basic metaphors described therein.
The surprising thing to me is that most of the small details I rely were in OS X 10-15 years ago. If a Linux distro were created to mimic OS X 10.4 I would be perfectly happy using it as an everyday OS and recommending it to others. I keep hitting dead ends in my research, and it seems like the major desktop environments have a lot of architectural problems preventing them from implementing some basic UX improvements.
The barrier of entry to help develop these features also seems high to me, coming from web development.
https://www.businessinsider.com/apple-forced-uighur-labor-ip...
The trackpad woes are a clear priority for some members of the Linux community and I can visualize a future in which trackpads work nearly as well on Linux as they do on macOS. Offering consistent Mac-style keybindings everywhere (maybe through a GTK setting, like switching between Windows-style and Emacs-style?) seems like a harder problem, especially because of the politics and ingrained assumptions.
It surprises me that there isn't a distro or easy to use tool to use Mac-style keybindings, given the overlap of Macs and Linux systems in tech.
There are many subtle things that works amazingly well on macOS. Most immediately, scrolling with the trackpad is smooth, responsive, and smooth. On Ubuntu 20.04 (XPS 15 9550), my experience was pretty much the opposite and with visible tearing. I'm not trying to bash Linux, I want to move to it, but these are the things holding me back.
For navigation (end/beginning of line/word) I just learned Vim bindings, which are better anyway and work on any OS for pretty much every text editor.
https://github.com/pkulak/dotfiles/blob/master/.config/alacr...
I had no idea that Mac used emacs bindings all over the place though. If I was used to using them, that would probably have been a deal breaker for me too.
I even prefer my PC trackpad on Linux vs my Mac trackpad on macOS because on Linux there are many more settings I can configure to get it working exactly to my liking.
Personally, I don't like the cursor acceleration profile in macOS by default. You can change certain values through the terminal, but the Synaptics and libinput options on Linux are way more in depth and packaged in a nice GUI (at least in KDE Plasma).
2012: Sony Vaio, running linux: Trackpad was infuriating, so I used an external keyboard + mouse. I'm not sure what it was - the sensitivity of the trackpad was very high so it was hard to point at things, combined with separate buttons.
2015: Macbook pro. The trackpad was so good, and gestures so well done and supported, that I _won't use a mouse_ anymore on my work machine. (Five years later, still feel the same.) Clicking was as easy as tapping on the trackpad, and scrolling with two fingers (as well as two-finger click as right-click) works flawlessly.
2015: My wife has a windows laptop, and its trackpad is infuriating. While in theory it can be clicked anywhere, I always have to _Very Deliberately_ click (significantly harder than on my macbook's trackpad) before it can reliably register.
2018: Using a newer (2016) macbook, with touchbar and a larger trackpad. This has a larger trackpad, but it somehow doesn't register incidental thumb-bumps on the trackpad as clicks (an issue that my older mac sometimes would do).
2020: I moved to a 2020 macbook pro, my wife has a new windows laptop, and we have a Chromebook. I've used them all -- and still notice a strong preference for the mac's trackpad.
Windows trackpad handling has improved a TON since her old laptop, and it no longer feels like I need to press super hard to get clicks to register, but it still feels more finicky about recognizing clicks than the mac does, while still being harder to get the pointer where I want it to be. It also seems to react to accidental touches on the trackpad that the mac would ignore while typing. The chromebook's trackpad seems better than I expected for a $300 machine, and is better than her old laptop's trackpad, but it still doesn't seem quite as responsive as the mac's.
I'm not sure how much of this is hardware versus drivers. Windows laptops seem to be Very Good, in fact, these days. I still prefer the mac's trackpad behavior better, though.
PC laptops are catching up lately for sure though. Almost there. (I havent even tried some of the latest stuff, I heard Razer has really good "Precision" trackpads?)
I have libinput-gestures working just fine with 2, 3 and 4 finger events, although I vastly prefer a 5-button vertical mouse (Evoluent) and keeping my fingers on the keyboard over a touchpad...
With some small scripts I was able to have things that macOS can't do out of the box at all, like maximizing windows, snapping windows - pretty much anything I could script, I could do with a touchpad gesture.
One thing that really matters - you have to have the right brand of touchpad for it to work. Mine is an Elantech (ELAN0501).
Did you succeed? For me that was the point where I gave up and just went back to OSX
It is still very cool to be able to tune fonts that precisely on Linux, and it's a major feature.
Also, on many linux distribution you can modify your font configuration per user, here ~/.config/fontconfig/fonts.conf (path may vary).
I don't really have the patience to faff about with font config files, it should 'just work'.
DirectWrite has a whole bunch of flags that configure sub-pixel and anti-aliasing as well as natural widths etc. So it might not look the same. To make matters worse it changes what settings it uses depending on the size of the type IIRC and even had a few font-specific tweaks there as well.
Windows apps in general might not look the same depending on whether they are using GDI, GDI+, DirectWrite (all considered native) and any combination of those flags... and of course it depends on whether the user has ClearType turned on and if they have used the Tuner to calibrate the rendering further for their preference...
Agreed. While much of the discussion surrounds making font rendering more Mac-like, fontconfig enables people to modify font rendering to suit their personal needs. For example: one user can turn off anti-aliasing to enjoy sharper fonts, while another turn it on to enjoy more accurate font rendering. Heck, you can even tweak things down to the font and application level without relying upon each program exposing that functionality.
This is not the sort of feature that will appeal to many people, but it is incredibly useful for those who use it.
With Inter, I'd probably use Hack, an update on the great DejaVu Mono which was also the source of Apple's Menlo, their previous default. It shares some features with Inter like a single-story g.
https://stackoverflow.com/questions/32178464/is-possible-to-...
Microsoft chose to align strokes as close as possible to pixel boundaries for a sharp, crisp look even if it meant distorting the shape of the glyphs. Apple on the other hand decided to render fonts as close as possible to their original shapes even if it caused some blurriness around pixel boundaries.
Linux made its own flavor of both options, and left it to the user to decide which one they wanted. The default on many distros is closer to the Windows look, though. So if you are used to the Windows look, you will probably prefer the default option than the tweaked-to-look-like-Mac option.
Not an impressive way to start. I do not like the fonts on MacOS at all. IMO Mac fonts are the worst of all the major OSes. Windows, Linux, and ChromeOS are all better than the atrocity that is Mac fonts. Of course, that is because I use those other OSes more than MacOS, so they're the basis for me to decide what is "correct".
All the major companies have poured lots of money into engineering typefaces specifically for their UI and brand. They're all designed to be easy to read and give off just enough personality to not be distracting. Objectively, I'd be surprised if one were better than another.
I like some of the open source sans serif fonts just as much as Apple's SF fonts. Google's Roboto has a bit too much personality IMO, but it might be better tuned for Android than the web.
I can't quite put my finger on it, but somehow on Linux (Mint cinnamon) the pointer always ends up in a place just slightly off from where I expect it to be. Also the movement feels jerky...
1) the Mac world has moved onto high-DPI screens mainly,
2) subpixel rendering provides virtually no benefit on high-DPI screens, and
3) subpixel rendering adds a ton of complications across the board (you can't scale anything, for starters), and was always hacky to begin with -- e.g. taking a screenshot and putting it on the internet gives it a rainbow halo effect on everyone else's screen
Honestly, these days with graphics cards that support Retina, the "right" way to do subpixel rendering on non-Retina screens wouldn't be with fonts at all. It would be to render everything internally normally at 3x resolution (3x horizontal by 1x vertical), and then apply subpixel rendering to the whole screen when downscaling for display. But with so few non-Retina screens being used by Mac users, why bother?
Actually I am using a Retina display. I’m still noticing the difference very much. Hence I don’t think subpixel rendering would be only a technique for obsolete devices.
But I don’t think subpixel rendering is a performance issue, my MacBook Pro running 10.11 displays everything fast even though being 6 years old.
And if the complications were already there, perfectly working, why remove them? I understand that it is hard to add these features into the iOS libraries, but then the others should have been kept as is.
I'm curious why you think you notice a difference? Macs have never had subpixel rendering for Retina, so if I'm understanding you correctly, it's not something you could know from experience. Why do you think it would make a difference you could notice if they did?
(And of course, Retina rendering is far sharper than lo-dpi subpixel rendering.)
I suppose you might be able to take an image of subpixel-rendered text e.g. at 24 pt, scale the bitmap to 50% width/height on a Retina display, and put it next to the same text at 12 pt, and see if you could tell the difference. Although you'd need to be careful to get the same precise vertical baseline alignment.
I suspect you are not running at the "correct" 2X Retina resolutions, which for whatever reason are no longer the default on Apple Macbooks. Instead, they end up running at a 1.75x or 1.5x of native resolution, which results in slightly less crisp rendering for everything, not just fonts.
But I get it. From their perspective, those aren't Apple screens, so they don't need to support them.
100% speculation: Apple has a history of very narrowly supporting only their latest few generations of equipment. It's possible that they're ignoring "legacy" devices in these decisions with the justification probably being that "They'll buy a new one eventually anyway."
Edit: added missing words.
It has no such history, quite the opposite. You can install the latest OS on 5 year old phones and 8 year old Macs.
[1] https://www.urwtype.com/en/shop/?fontshop=datei%3Asearch_db%... --- Sorry I couldn't find a better link.
Also loved the FreeFont family, it was what I used before Nimbus.
https://wiki.archlinux.org/index.php/fonts
I currently use
https://github.com/belluzj/fantasque-sans for Monspaced Font.
For everything else, I use Noto Sans. Looks Well.
Nor GTK, nor Qt do support "full" hinting as of few recent releases.
Pango, and Harfbuzz sacrificed that ability in exchange for subpixel letter positioning.
- macOS uses no sub pixel hinting since High Sierra. Instead, it's just grayscale antialiasing. To make up for the unnatural thinness that occurs when grayscale antialiasing is used, fonts are artificially bolded by a small amount.
- Linux/FreeType uses very nice-looking sub pixel hinting and maintains the clarity of fonts pretty well. The spacing between characters may not be pixel-perfect, if I remember correctly.
- Windows/ClearType snaps fonts to the pixel grid very aggressively, resulting in some amount of distortion. Many of the default Windows fonts look really good with ClearType, while others appear strange, especially at smaller sizes. In terms of technology, ClearType is the most advanced.
I don’t know the timelines involved, but my impression was that macOS’s glyph dilation has been there from the start, or at the very least waaaaay before they threw away their subpixel antialiasing. (When you wrote “sub pixel hinting”, I’m presuming you actually meant subpixel antialiasing, though feel free to correct me; but hinting and antialiasing are entirely different things, and “subpixel hinting”, which I imagine would mean hinting to subpixel boundaries (which would also seem a weird thing to do), isn’t a standard term.)
Using greyscale antialiasing doesn’t inherently make things appear thinner or thicker. The only thing that will make things appear thinner or thicker is if the antialiasing is done in the wrong colour space, typically meaning linear versus gamma-corrected.
Behdad has since axed usage of hints from True/OpenType fonts. Though the rationality of "more precise positioning" is kind of irrelevant on modern HiDPI screens.
Both macOS and Windows were designed at a time when screen resolutions were under 100dpi. My take is that Apple favored font rendering to mimic printed text as much as possible and Microsoft went with legibility at all costs with ClearType.
But to me, Windows font rendering is awful, of just terrible taste.
High resolution screens makes it all much less of an issue, but both Linux and Windows still struggle in that regard as well.
Whenever I sent Linux screenshots, my windows colleagues remarked how much better fonts looked in my screenshots.
Sub pixel rendering, which they all had (Likely a Windows default at the time?) sounds good but just looks blurry in practice.
It adds some funny color artifacts when the capture is not perfectly aligned to the screen because subpixel information is encoded as color variations.
On macOS there is little or no hinting, the result is less contrast and, at smaller text sizes on standard-resolution displays, eye strain; the upshot is that the shape of the fonts is generally more faithful, of course, macOS undermines this by completely changing the weight of fonts when you enable subpixel antialiasing (which is why there's CSS all over the internet turning that off).
On FreeType2 w/ Pango/Skia/etc (Linux/BSD/Android/iOS), the subpixel rendering actually works properly and doesn't change the weight of the font, and on the horizontal axis the hinting is mild or completely off, and the vertical hinting is less mild or quite aggressive. Most FreeType2-based renderers now position glyphs on thirds of a pixel, when the display can supports that. I personally prefer the default fontconfig on Arch Linux over every other text renderer.
Windows has ClearType, it is by far the sharpest text of the bunch, and at standard text sizes that can make it very legible. The tradeoff is that it completely mangles the shape of fonts, and the result only vaguely resembles it; furthermore there is such a thing as too much contrast and I find that ClearType can feel harsh and causes me a form of... aesthetic fatigue?
Overall it seems that there is a whole spectrum of ruthless efficiency vs. aesthetic considerations. I don't think there is a universal scientific answer to these questions.
Of course, once you have 3x standard resolution displays it doesn't much matter as long as you aren't mangling the fonts some other way, at some point you don't even need to antialias.
Reference: https://wiki.archlinux.org/index.php/Font_configuration#Font...
- /et/... should be /etc/...
- not assuming your editor is neovim.
- not assuming those fonts are installed.
Some people like the font hinting and antialiasing in macOS. I don't. Fonts get really thick and hard to read.
Retina mode makes fonts vastly more readable but it requires a $1000+ Apple monitor. On Linux I can plug a $300 monitor, switch resolution to 4k, set display scaling to 2x and save myself $700+.
What really sucks is that websites like Wikipedia use it, and you have to suffer reading this horrible font.
I'm super-thankful for this post. I'm definitely going to try this out.
Thank you again!
Would be great if Linux distributions provided similar expanded font setup out of the box.
However, setting up the fonts that you want on linux can be a bit tricky and I've lost many hours trying to get a config that does it for me, so good job for the guidance that you provide.
There's enough things to fiddle with on linux.