If you have used Homebrew to manage your packages, you can also use it to install fonts on your macOS so long as the fonts are available. And as you’ll see in the example below, this is way easier (and quicker) than downloading the fonts and install them conventionally.
If you haven’t, it’s quick to install Homebrew. Just open your Terminal and type in the following:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
For the latest update of this command, please check Homebrew’s website. You just need to copy the command line and paste it in your Terminal.
Here are some commands you need to know. You need to run this once:
brew tap homebrew/cask-fonts
Then, as I want to try to install some fonts with ligatures from Microsoft such as Cascadia Code and Fira Code, I want to search them first if those fonts are available.
To search the font, you can type in this command:
brew search font- | grep cascadia
Which would give the result (at this time):
font-cascadia-code font-cascadia-code-pl font-cascadia-mono font-cascadia-mono-pl
We’re in luck, it’s available.
Important: The font name is all in lowercase and it’s case-sensitive. For example, you will not find anything if you typed in “Cascadia” as your search word.
Now, we just need to install the Cascadia Font by typing this command:
brew cask install font-cascadia-code
Once completed, your font is installed and active. But in this specific example, if you use Visual Studio Code, even though the font is active, you still need to enable the font ligatures before you can see it.
If you use Sublime Text on the other hand, the change is instant.
That’s all there is to it. So far, we’ve just installed one font Cascadia Code, if you also want to install Fira Code font, you can do it on your own. That would be a good exercise for you.
Additional Note
If you just run the command brew search font-
without grep
, you will get a list of all available fonts you can install via Homebrew.
Leave a Reply