macOS 批量安装Nerd Font¶
概要: 使用brew工具在macOS上批量安装Nerd Font
创建时间: 2022.11.20 21:39:25
更新时间: 2022.11.20 21:58:24
什么是Nerd Font¶
Nerd Font 相比于传统的字体,支持了更多的符号和图标显示,可用于 oh-my-zsh
的高级主题(如 romkatv/powerlevel10k: A Zsh theme),效果如下(图源官网)
使用brew安装Nerd Font¶
配置 cask-fonts¶
Bash | |
---|---|
搜索 Nerd Font¶
使用如下命令可以搜索到全部的Nerd Font,为便于安装比对,将搜索结果输出到 brew-nerd-fonts.txt
文件中
Bash | |
---|---|
安装单个 Nerd Font¶
在上面输出的 brew-nerd-fonts.txt
文件中,可以自由选择安装的 Nerd Font,如 FiraCode Nerd Font,使用如下命令安装
Bash | |
---|---|
批量安装 Nerd Font¶
首先写一个简单的 shell 脚本 install-fonts.sh
,内容如下
Bash | |
---|---|
Bash | |
---|---|
Bash | |
---|---|
检查已安装Nerd Fonts¶
Bash | |
---|---|

画上对勾的表明已安装完毕,注意如果IDE需要使用刚刚安装的字体,可能需要重启软件