7 ms·
Installing Fonts Using Homebrew
- hs86 9y agoLinux users might laugh at us but this is still very convenient and according to the upvotes still new for some people. It might be less polished than this solution but on Windows the same can be done with Chocolatey: https://chocolatey.org/search?q=font https://chocolatey.org/search?q=font
- kbd 9y ago> Linux users might laugh at us... Why? I have my system config source controlled and even have a bootstrap script to set up a new Mac from scratch that installs Homebrew, which installs git and Python, and then installs via Homebrew all my system packages and casks like Google Chrome, iTerm2, Spotify, etc. plus programming language packages through their respective package managers, etc. And now fonts (which I only discovered the tap for a little while ago). That's one less thing to install/update manually and it's very appreciated.
- ahstilde 9y agoCan you share this magical file?
- jph 9y agoHere are my brew install files: https://github.com/sixarm/sixarm_brew_install https://github.com/sixarm/sixarm_brew_install
- kbd 9y agoHere's my setup repo with all my system config: https://github.com/kbd/setup https://github.com/kbd/setup Here's the bootstrap script I mentioned: https://github.com/kbd/setup/blob/master/bootstrap.py https://github.com/kbd/setup/blob/master/bootstrap.py Here's the config file with everything I install, settings, etc.: https://github.com/kbd/setup/blob/master/settings.py https://github.com/kbd/setup/blob/master/settings.py
- pxc 9y ago>> Linux users might laugh at us... > Why? As a mostly exclusive user of GNU+Linux for the past 9 years who started using a Mac last year because it was issued to me by my employer: because Homebrew lacks many of the strengths of the kinds of package managers you find in the Linux ecosystem. It only half-installs some packages, leaving you to manually link things in to certain directories (it was like this with Varnish a few months ago, and maybe still is). It's generally nondeterministic. Huge parts of it are basically scripted installation of preexisting binary packages, putting it more on par with Chocolatey or yaourt than a tool like apt backed by proper repos with source packages. More on the topic of fonts in particular, there are tons of reasons that Apple's font handling, especially but not only in terms of installation and configuration management, is an embarrassment. macOS lacks configurable font substitutions, so extended characters like those provided in the ‘nerd fonts’ can only appear in applications which can be explicitly configured to use those fonts. Certain fonts are considered ‘required’ parts of the system, so that to modify or remove them on a Mac you have to disable System Integrity Protection, and a whole host of apps will simply crash on startup if, e.g., the Apple Color Emoji font is missing. macOS ignores emoji embedded in fonts that the user has chosen, and instead always injects the Apple emoji. Font rendering in macOS and iOS has been the source of numerous crashing and freezing issues of such a similar kind to one another that it is somewhat surprising and interesting that the entire class of such bugs wasn't fixed after the first major incident (as has been discussed on Hacker News recently). Homebrew is also basically incapable of reliable uninstallation of packages; common advice is to use separate prefixes or wipe your whole installation with a series of commands that force you to reckon with the internal structure of Homebrew. It's not always compatible with other package managers for macOS, so care has to be taken if multiple alternatives are supposed to be usable. The state of Homebrew installations is so frequently a broken one that they have a dedicated subcommand for trying to figure out why Homebrew is broken in `brew doctor`, and sometimes breakages are caused by updates to macOS itself, which are installed via a separate mechanism. And even when it works, Homebrew is essentially still always operating on fundamentally two distinct kinds of packages (traditional source-based installations in the FHS and macOS-specific `.app` bundles), whose difference is noticed and felt by every user because different subcommands are used for handling such packages, and they end up in different places. I'd imagine, too, that the fact you had to write your own bootstrap script could be part of what the parent poster was getting at, in that Linux has a ton of choices for configuration management tooling due to its presence on the server. Homebrew is an awesome effort, and I use it whenever Nixpkgs is missing something I don't feel like packaging myself. The casks are really nice because almost every end-user application on macOS is distributed as a DMG archive that extracts to a .app folder, so there are not as many applications one must use a browser to hunt for as there are on Windows. I wouldn't want to mock macOS users over this, nor to disparage all of the useful and impressive work that Homebrew contributors have done in retrofitting macOS with a package manager which can do a lot. And to the extent that a bootstrapping script based on tools like Homebrew gets its job done, it is a success in its own right. But Homebrew offers nowhere near the control, speed, or basic featureset of something like apt, Portage, Nix, or zypper. And it's not integrated into the system like the native package manager is on any Linux distro. There's a lot for Linux users to miss from their old package managers when they're using Homebrew on macOS. And the font situation on macOS is a controlling, user-hostile travesty to anyone who expects their OS to do what they tell it rather than the other way around, and disconcertingly coupled with core system components besides. tl;dr: Homebrew is a great project, but habitual Linux users on macOS know there's no place like home when it comes to package management (or font configuration, for that matter)
- kevindong 9y agoHow often do you set up a new Mac?
- kbd 9y agoNot often, but I'm a software dev, I like things to be reproducible. So I always install everything through "setup brew" ('setup' is my program), and then the only part of my setup that is particular to a new machine is my bootstrap, which is like 30 lines of code: https://github.com/kbd/setup/blob/master/bootstrap.py https://github.com/kbd/setup/blob/master/bootstrap.py Also, ever set up a new machine and then for days you keep finding system config that's not how you like, or things that aren't installed that should be? I even set my Mac's settings (defaults write ...) through my setup program. I started a new job fairly recently and my system was up and how I like it in one step.
- adamisntdead 9y agoA bash script works too: https://github.com/adamisntdead/devmymac https://github.com/adamisntdead/devmymac
- jph 9y agoSimple `brew install` shell script for many fonts: https://github.com/SixArm/sixarm_brew_install/blob/master/brew-install-our-fonts.sh https://github.com/SixArm/sixarm_brew_install/blob/master/br... If you prefer using a `Brewfile` for many fonts: https://github.com/SixArm/sixarm_brew_brewfile https://github.com/SixArm/sixarm_brew_brewfile Feedback and PRs welcome.
- asaph 9y ago> I could even have the script in Dropbox and have it run periodically in the background using a launchd service to keep everything in sync. I recommend GitHub over DropBox for storing this script.
- jenhsun 9y agoThe best way to me is just clone https://github.com/ryanoasis/nerd-fonts https://github.com/ryanoasis/nerd-fonts and look into the `pateched-fonts` folder, see what font you might like and do `./install.sh <font name>`. That's it.
- wiradikusuma 9y agoI use Skyfonts to install fonts from Google Fonts. Unfortunately you can't create account for Google Fonts, so you end up doing select-and-install for each device you own (i.e. no syncing). At least it's (slightly) better than manually downloading it, unzipping, double-clicking, etc (you get the idea).
- ellisv 9y agoAuthor didn't mention it but you can then list available fonts with `brew search font-`
- sinistarjab 9y agoAnyone got any strong recommendations?
- tomsthumb 9y agoAnonymous Pro, especially when you use a smaller font size Terminus for fans of the old school
- wintorez 9y agoApart from a few apps that are App Store exclusive, I install everything on my Mac using Homebrew and Homebrew Cask. I highly recommend it to anyone who has not used them before.
- jenhsun 9y agoYep, and below line will help you a lot. $brew update && brew upgrade && brew cu -ayq
- nikolay 9y agoI am surprised that so many people write scripts to do stuff that Homebrew offers already - Homebrew Bundle [0]! Also, why do people copy & paste `brew install` or `brew cask install` so many times in a script when you can do something like `xargs`? [0]: https://github.com/Homebrew/homebrew-bundle https://github.com/Homebrew/homebrew-bundle