MacOS-like Fonts on Manjaro/Arch Linux
aswinmohan.me
aswinmohan.me
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...
[1]: ± some depending on if you count multiple ways of creating the same character, etc. Eg. ‘≠’ can be made by combining / and = in either order. Also ‘Compose, number, s’ for footnotes, ‘Compose, +, -’ → ±, ‘Compose , <, '’ → “‘”, ‘Compose, -, >’ → “→”, ‘Compose, =, >” → “⇒” are nice. And υɳⅰеηⅽоⅾе.
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.
I used to hate Mac shortcuts, because I never really spent more than 30 minutes with the system. I think there is nothing to hate - they are just different and IMO better.
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.
Did you succeed? For me that was the point where I gave up and just went back to OSX
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...
None of this "excuses" Apple; it's just that there's something faintly disingenuous about focusing on them as if they were a unique source of this problem. We could just as easily say "your Nintendo Switch is manufactured by literal slaves in concentration camps," but we don't, because... it's not as satisfying to be outraged at Nintendo, I guess?
At any rate: I strongly suspect the OP was referring to recent controversy surrounding the way Apple runs the App Store.
Apple and Foxconn both claim to be unaware of any irregularities, and Apple said they're investigating.
I rather think the OP meant something more like their practices surrounding their App Store than this not-quite-substantiated and hyper-sensationalized claim.
They haven't changed because moving away from china would cost them billions and they as most people would rather keep themselves warm with a pile of money than worry about the ethical implications.
But now you've shifted from the part I found dubious--that companies are knowingly engaging in slave labor--to a more clearly established pattern. One can be both horrified by China's treatment of Uigher people and skeptical that Foxconn, Apple, or any one of the 82 companies to which you've referred are complicit.
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).
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.
All the control characters have pre-existing meaning, for example in bash Ctrl-C sends SIGTERM to the foreground process, while emacs uses it a prefix command, etc.
This is the crux of the problem. You _cannot_ steal the control characters if you want the terminal to be a terminal and that means you either end up with an inconsistent mess or you pick a new and neutral (say, Cmd) modifier for your UI needs. Apple got it, Microsoft didn't (because they didn't do anything Unix like). That Linux chose to imitate Microsoft is equal part historical and tragedy. EDIT: typos'R'Us
Not to drag us too deep into philosophy, but you can make a pretty good case for the Linux way as well. On my machine, the super key is mapped exclusively to window manager shortcuts. It's how I move, close and resize windows, change splits, open apps, switch workspaces, pop open temp terminals, emojii choosers, a calculator, all that quality of life stuff. Copying and pasting is an app thing, and apps get ctrl and alt as their modifiers. It does make sense to me.
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 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.
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.
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...
Also try reducing mousewheel.min_line_scroll_amount if changing the other setting doesn't help. Try a value of 16.
The default is 100, which seems to work fine most of the time, but for the OP's issue, reducing it by a factor of ten might be a good starting point.
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.
What do you mean by few? Apple releases new phones every single year and has for the past 12.
5 years means 5 generations.
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.
If you're really looking for maximum crispness you might prefer Acrobat. It makes subpixel rendering unnecessary for all perfectly vertical and horizontal strokes, since it's trying to avoid antialiasing them in the first place.
Apart from the Acrobat solution, on macOS 10.11, it is possible to turn off text smoothing in Preview.app's PDF settings (which retains subpixel rendering). This gives, to my eyes the best PDF rendering that macOS had up to now.
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.
The only seeming authoritative source I could find that justifies why it was ultimately removed is from an "ex-macOS SWE" here [2].
[1] https://graphicdesign.stackexchange.com/questions/8277/how-d...
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.
The solution is conceptually simple: just like the iPhone X renders at 3x, Macs should be able to render internally at 3x as well, so that downsampling to 1.75x or 1.5x will still have full detail, zero blurriness.
I wonder if the reason it can't is performance, if it's battery, or if there isn't enough memory on the video card or something.
But seeing as MacBook Pros can support multiple 4K monitors... it seems like the memory and performance are there, no?
Because I'd love if that were true, but every explanation I've seen contradicts that.
The default isn't more space, as you write -- it's actually less space, for bigger elements. Which is why you would need to render at more than 2x. It does, indeed, scale up -- there are plenty of articles from when Retina's scaling options came out that state it does lead to a slight amount of blurriness because of this.
To be clear, under Display > Scaled, the "More Space" option is true 2x retina, while "Default" through "Larger Text" are the ones that upscale.
You can actually verify this yourself -- it you take a screenshot of any UX element at "More Space", and then take a screenshot of the same element at "Larger Text", they're pixel-for-pixel identical. For everything less than "More space", MacOS is scaling up.
You are correct that if you go down to the "bigger text" side of things that it does scale things up, and for those sizes using 3x would give a sharper image. I hadn't even considered that though because I think most people think either the exact 2x retina resolution is fine, or if anything they want more space. The only people who would use the "bigger text" option are probably people with poor eyesight in which case it doesn't matter if its slightly more blurry.
EDIT: see screenshot here: http://imgbox.com/uxcHERt3 Default for MacBook Pro 13" is "Looks like 1440x900" which requires rendering at a resolution of 2880x1800, which is then scaled DOWN to the native resolution of 2560x1600.
> I know on my 2018 MacBook Pro 13" the default was one notch over on the "More Space" side vs. exact 2x Retina
That's what I meant -- it's less space (one notch over, the one labeled "Default") compared to exact 2x which is labeled the "More Space" option.
> The only people who would use the "bigger text" option are probably people with poor eyesight in which case it doesn't matter if its slightly more blurry.
I guess that's where we disagree -- my eyesight is great but I like the text on my screen to be comparable with the size of body text in books, not the size of footnotes. I like a comfortable amount of text information on screen, not crammed. And the fact this is the default option makes it seem that Apple agrees.
And that's precisely why I wish it didn't add the bluriness from the upscaling, why 3x internal would be valuable.
There were a bunch of articles way back when the scaling options were introduced that claimed anything less than "maximum space" introduced blurriness... but they were obviously wrong.
I just did the math and double-checked with screenshots, and indeed — on my 13" MacBook Pro the default is higher than 2x, not lower. It's only at the leftmost "larger text" that blurriness is introduced.
Thanks so much for the info, and I'm happy to know I am getting maximum clarity out of my Mac after all! Always good to get my misinformation corrected.
And so, never mind about the whole 3x thing... you're right, unless you need text extremely large. Cheers!
Actually, the requirement to stay with the 2x is a reason I dislike macOS 11.0 Big Sur (even more than 10.14+) because it increases paddings everywhere. Hence, its effectively a loss of real estate. This loss can be mitigated by increasing the resolution to <2x retina, but of course with subpar visuals, unfortunately.
But I get it. From their perspective, those aren't Apple screens, so they don't need to support them.
[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.
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.
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.
Yep, I think you're right about this. I can no longer edit my comment, but pretend I did a quick s/hinting/rendering/g.
> 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.
Huh, thanks for the correction. Do you have any idea what the "Use font smoothing when available" setting actually does, given that it makes fonts thinner and more similar-looking to Windows rendering when turned off?
Bit of a crock calling it “font smoothing”, I reckon, but that’s what they call it there and I can’t stop them.
(In all this about macOS, I’m going almost entirely on what I’ve seen and heard from others. I’ve never had a Mac.)
That seems misleading, though, because there is clearly some amount of antialiasing happening regardless of which option is chosen.
I think you're probably right. To be honest, everything in macOS seems to be designed with that switch on, so turning it off makes fonts in many areas look noticeably worse.
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.
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.
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.