34 KiB
Nerd Fonts 是一个使用大量字体图标来解决程序员在开发过程中缺少合适字体的问题的项目。它可以从流行的字体图标库中将大量外部字体引入待开发的项目中,它支持的字体图标库包括 Font Awesome ➶, Devicons ➶, Octicons ➶, and others.
下面的桑基图展示了Nerd Fonts中现有的字形组合:
创建图表的工具为: @SankeyMATIC
快速导航
Latest Release ➶ | Fonts | Patcher | VimDevIcons ➶ | Font Package Downloads ➶ |
---|---|---|---|---|
重要提示
master
分支的文件路径 不稳定! 验证你的 repository URI references- 除非你想成为开发贡献者,不然最好不要克隆这个 repository。
目录
- 1 - 手动
- 2 - 下载发布存档
- 3 - 安装脚本
- 4 - Homebrew Fonts (macOS (OS X))
- 5 - 克隆 Repo
- 6 - Ad Hoc Curl 下载
- 8 - Arch Linux Repository (Community, AUR)
- 8 - 你自己的字体补丁
附加信息
TL;DR
Nerd Fonts 中包含流行的程序字体和字形。 如果你想要的字体没有在现有的字体库中,你可以使用 font patcher来自定义字体。 更多信息请见 wiki。如果你正在寻找Vim插件,请见 VimDevIcons ➶。
多种字体下载选项
如果你...
选项 1.
需要快速从patched-fonts/
directory下载一个 独立字体选项 2.
需要去下载包含粗体、斜体等等一系列字体的 字体家族,请见 下载档案选项 3.
需要自动安装或使用脚本,请见 安装脚本选项 4.
是macOS的使用者,并且想要使用Homebrew,请见 Homebrew Fonts选项 5.
想要 完全控制,请见 克隆这个 repo选项 6.
想要使用curl
command 或者使用 scripts,请见 Ad Hoc Curl 下载选项 7.
是Arch Linux的使用者,并且想要使用Community packages,请见 Arch Community Repositories选项 8.
想要打包你自定义的字体,请见 字体补丁
特征
- FontForge Python script 可以打包任何字体
- 包括建立Monospaced (fixed-pitch, fixed-width) 或者 double-width (non-monospaced) 字形
- 更多详情请见 Font Patcher 段落
50
已经 打包了字体家族- Over
1,571,470
独立的 组合/变型 字体 (更多详情) - Over
9,000
字形/图标 组合 (更多详情)- 当前的字形集包括: Powerline with Extra Symbols, Font Awesome, Devicons, Octicons, Font Logos, Pomicons
- 每种字体的Monospaced (fixed-pitch, fixed-width) 和 double-width (non-monospaced) 版本
- 这指的是Nerd Font字形本身,并不一定需要将字体作为一个整体考虑
- 一个 开发者/贡献者提供了 bash script 来为所有字体再打包
字形集
🔍 🔍 你现在可以通过NerdFonts.com中的Cheat Sheet对字形进行搜索
Shell中的Icon 名称
从bin/scripts/lib/路径中下载 .sh
文件, 推荐的文件位置为 ~/.local/share/fonts/
或者 ~/bin/
.
i_all.sh
- 帮助你加载你下载的所有文件i_dev.sh
- Devicons (198 icons, 8 does not have an established name)i_fa.sh
- Font Awesome (675 icons, 111 aliases)i_fae.sh
- Font Awesome Extension (170 icons)i_iec.sh
- IEC Power Symbols (5 icons)i_logos.sh
- Font Logos (20 icons)i_oct.sh
- Octicons (172 icons)i_ple.sh
- Powerline Extra Symbols (37 icons, 2 aliases, 16 does not have an established name)i_pom.sh
- Pomicons (11 icons)i_seti.sh
- Seti-UI + Custom (50 icons, 2 aliases, 5 does not have an established name)
然后 source
所需的文件并且输出 $i_*
variables 去寻找字体:
source ~/.local/share/fonts/i_oct.sh
echo $i_oct_heart
# Output:
# ♥
NOTE: You have to use one of the Nerd Fonts to see correct icons for some icon sets (Devicons, Font Awesome Extension, Font Logos), but other sets should work with their standard fonts too.
字体补丁
Font Name | Font Name and Repository | ver | *RFN | Status |
---|---|---|---|---|
3270 Nerd Font | 3270 | 3.0.1 | NO | |
[Agave][p-agave] | [Agave][f-agave] | 37 | NO | |
AnonymicePro Nerd Font | Anonymous Pro | 1.002 | YES | |
[Arimo][p-arimo] | [Arimo][f-arimo] | 1.33 | NO | |
Aurulent Sans Mono Nerd Font | Stephen G. Hartke | NO | ||
[BigBlueTerminal][p-bigblueterm] | VileR | NO | ||
Bitstrom Wera Nerd Font | Bitstream Inc | 1.1 | YES | |
[Blex Mono][p-blex] | [IBM Plex Mono][f-ibm-plex] | 2.3 | YES | |
[Caskaydia Cove Nerd Font][p-cascadia] | [Cascadia Code][f-cascadia] | 2111.01 | YES | |
Code New Roman Nerd Font | Sam Radian | 2.0 | NO | |
[Comic Shanns Mono Nerd Font][p-comic] | [Comic Shanns Mono][f-comic] | 1.3 | NO | |
[Cousine Nerd Font][p-cousine] | [Cousine][f-cousine] | 1.211 | NO | |
[DaddyTimeMono][p-daddytimemono] | [DaddyTimeMono][f-daddytimemono] | 1.2.3 | NO | |
DepartureMono Nerd Font | Departure Mono | 1.422 | NO | |
DejaVu Sans Mono Nerd Font | [DejaVu][f-dejavu] | 2.37 | NO | |
Droid Sans Mono Nerd Font | Ascender Corp | 1.00-113 | NO | |
Fantasque Sans Nerd Font | Fantasque Sans | 1.8.0 | NO | |
Fira Code Nerd Font | Fira Code | 6.2 | NO | |
Fira Mono Nerd Font | Fira | 3.206 | NO | |
[Go Mono Nerd Font][p-go-mono] | [Go-Mono][f-go-mono] | 2.010 | NO | |
Gohu Nerd Font | [Gohu TTF][f-gohu2],Gohu | 2.0 | NO | |
Hack Nerd Font | Hack | 3.003 | NO | |
Hasklug Nerd Font | Hasklig | 1.2 | YES | |
Heavy Data Mono Nerd Font | Vic Fieger | 1 | NO | |
Hurmit Nerd Font | [Hermit][f-hermit] | 2.0 | YES | |
[iM-Writing][p-im-writing] | [iA-Writer][f-ia-writer] | Dec 2018 | YES | |
Inconsolata Nerd Font | [Inconsolata][f-inconsolata] | 3.000 | NO | |
Inconsolata Go Nerd Font | [InconsolataGo][f-inconsolatago] | 1.013 | NO | |
[Inconsolata LGC Nerd Font][p-inconsolata-lgc] | [Inconsolata LGC][f-inconsolatalgc] | 1.3 | NO | |
Iosevka Nerd Font | Iosevka | 22.1.0 | NO | |
[Iosevka Term Nerd Font][p-iosevka-term] | Iosevka Term | 22.1.0 | NO | |
JetBrains Mono | JetBrains Mono | 2.304 | NO | |
Lekton Nerd Font | [Lekton][f-lekton] | 34 | NO | |
Literation Mono Nerd Font | Liberation | 2.1.5 | YES | |
[Lilex Nerd Font][p-lilex] | [Lilex][f-lilex] | 2.300 | NO | |
Meslo Nerd Font | [Meslo][f-meslo] | 1.21 | NO | |
Monofur Nerd Font | Tobias B Koehler | 1.0 | NO | |
Monoid Nerd Font | Monoid | 0.61 | NO | |
Mononoki Nerd Font | Mononoki | 1.6 | YES | |
M+ (MPlus) Nerd Font | [M+ Fonts][f-mplus] | 2023/03 | NO | |
[Noto][p-noto] | [Noto][f-noto] | div | NO | |
[OpenDyslexic][p-opendyslexic] | [OpenDyslexic][f-opendyslexic] | 2.001 | NO | |
[Overpass][p-overpass] | [Overpass][f-overpass] | 3.0.5 | NO | |
ProFont (Windows tweaked) Nerd Font | [ProFont][f-profont] | 2.3 | NO | |
ProFont (x11) Nerd Font | [ProFont][f-profont] | 2.2 | NO | |
ProggyClean Nerd Font | Tristan Grimmer | 2004/04/15 | NO | Imperfect |
Roboto Mono | [Roboto Mono][f-roboto] | 3.0 | NO | |
Sauce Code Nerd Font | Source | 2.038 | YES | |
Shure Tech Mono Nerd Font | Share Tech Mono | 1.003 | YES | |
Space Mono Nerd Font | Space Mono | 1.001 | NO | |
Terminess Nerd Font | Terminus TTF | 4.49.2 | YES | |
[Tinos][p-tinos] | [Tinos][f-tinos] | 1.23 | NO | |
Ubuntu Nerd Font | [Ubuntu Font][f-ubuntu] | 0.83 | NO | |
Ubuntu Mono Nerd Font | [Ubuntu Font][f-ubuntu] | 0.80 | NO | |
[Victor Mono][p-victor] | [Victor Mono][f-victor] | 1.5.4 | NO |
*RFN = Reserved Font Name
字体集
- 超过
1,485,000
独立的 变化/组合(Power Set)字体包:50个
字体合集719
字体家族2,876
‘完全’的 变化/组合字体'1,485,410'
有可能的 变化/组合字体1,488,286
总字体数 (2,876 + 1,428,110)
- 每种字体的组合都是任意 Variations的组合
Variations
- no flags given (defaults to only Seti-UI + Custom and Devicons)
- double (variable/proportional) or single (fixed/monospaced) width glyphs
- Font Awesome
- Font Awesome Extension
- GitHub Octicons
- Font Logos
- Powerline Extra Symbols
- IEC Power Symbols
- Pomicons
- Windows Compatibility
字体安装
选项1: 手动下载并安装
安装特定 单独字体 的最快方法。
下载你选中的特定字体 patched font
选项2: 下载发布存档
适用于当你需要archive或者完整的字体家族(Bold, Italic, etc.)的情况。
你可以以压缩包的形式从latest release下载所需的字体
选项3: 安装脚本
适用于当你想要 自动 安装或者使用 scripts 的情况。
注: 仅适用于 Linux & macOS (OS X) 注: Requires cloning the repo as of now
所有字体:
- 安装全部的字体包 (警告:字体的数量众多,需要下载的文件体积巨大)
./install.sh
单独字体:
- 安装你所需的单独字体
./install.sh <FontName>
./install.sh Hack
./install.sh HeavyData
选项4: Homebrew 字体
适用于 macOS系统的Homebrew使用者。
所有字体都可以通过 Homebrew 字体 从 macOS (OS X)平台上找到
brew install font-hack-nerd-font
选项5: 克隆 Repo
适用于要使用 完全控制, 所有 或者 多数 字体的情况,或者为Nerd Fonts的开发 添一份力的情况。
基于效率考虑,如果你只想使用有限的几种字体,我们不推荐克隆这个 repository。
但是如果你想要克隆这个repo,请确认你_shallow_克隆了它:
git clone --depth 1
选项6: Ad Hoc Curl 下载
适用于当你想要使用
curl
command 或者在 scripts中使用它的情况。
Linux
mkdir -p ~/.local/share/fonts
cd ~/.local/share/fonts && curl -fLo "Droid Sans Mono for Powerline Nerd Font Complete.otf" https://github.com/ryanoasis/nerd-fonts/raw/HEAD/patched-fonts/DroidSansMono/complete/Droid%20Sans%20Mono%20Nerd%20Font%20Complete.otf
注: deprecated alternative paths: ~/.fonts
macOS (OS X)
cd ~/Library/Fonts && curl -fLo "Droid Sans Mono for Powerline Nerd Font Complete.otf" https://github.com/ryanoasis/nerd-fonts/raw/HEAD/patched-fonts/DroidSansMono/complete/Droid%20Sans%20Mono%20Nerd%20Font%20Complete.otf
选项7: 非官方 Arch Community Repository
适用于 Arch Linux 下使用 Community packages的情况
Most fonts are available via Arch Community packages. Some special packages are in AUR.
选项8: 打包你的个人字体
适用于 patching 你的 个人字体 或者深度 自定义 字体补丁。
在你的个人字体中使用 Python 命令行脚本去增加新的字形并生成字体包
请见: Font Patcher 的使用方法
- 这个选项适用于当你 不想 使用 fonts provided的情况
- 你需要复制已经生成好的字体到你系统中正确的字体文件夹中
可以通过VimDevIcons ➶打包你选中的字体:
- 需要: Python 3, python-fontforge package (version 20141231 或者更新版本,请见 安装说明)
- OSX上的替代安装方法为:
brew install fontforge
- 使用:
./font-patcher PATH_TO_FONT
- 替代方案: 使用script flag通过FontForge binary来执行打包:
./fontforge -script font-patcher PATH_TO_FONT
Nerd Fonts Patcher v3.0.2 (4.4.0) (ff 20230101)
usage: font-patcher [-h] [-v] [-s] [-l] [-q] [-c] [--careful] [--removeligs] [--postprocess [POSTPROCESS]] [--configfile [CONFIGFILE]] [--custom [CUSTOM]]
[-ext [EXTENSION]] [-out [OUTPUTDIR]] [--glyphdir [GLYPHDIR]] [--makegroups [{-1,0,1,2,3,4,5,6}]] [--variable-width-glyphs]
[--has-no-italic] [--progressbars | --no-progressbars] [--debug [{0,1,2,3}]] [--dry] [--xavgcharwidth [XAVGWIDTH]] [--fontawesome]
[--fontawesomeextension] [--fontlogos] [--octicons] [--codicons] [--powersymbols] [--pomicons] [--powerline] [--powerlineextra]
[--material] [--weather]
font
Nerd Fonts Font Patcher: patches a given font with programming and development related glyphs
* Website: https://www.nerdfonts.com
* Version: 3.0.2
* Development Website: https://github.com/ryanoasis/nerd-fonts
* Changelog: https://github.com/ryanoasis/nerd-fonts/blob/-/changelog.md
positional arguments:
font The path to the font to patch (e.g., Inconsolata.otf)
options:
-h, --help show this help message and exit
-v, --version show program's version number and exit
-s, --mono, --use-single-width-glyphs
Whether to generate the glyphs as single-width not double-width (default is double-width)
-l, --adjust-line-height
Whether to adjust line heights (attempt to center powerline separators more evenly)
-q, --quiet, --shutup
Do not generate verbose output
-c, --complete Add all available Glyphs
--careful Do not overwrite existing glyphs if detected
--removeligs, --removeligatures
Removes ligatures specificed in JSON configuration file
--postprocess [POSTPROCESS]
Specify a Script for Post Processing
--configfile [CONFIGFILE]
Specify a file path for JSON configuration file (see sample: src/config.sample.json)
--custom [CUSTOM] Specify a custom symbol font, all glyphs will be copied; absolute path suggested
-ext [EXTENSION], --extension [EXTENSION]
Change font file type to create (e.g., ttf, otf)
-out [OUTPUTDIR], --outputdir [OUTPUTDIR]
The directory to output the patched font file to
--glyphdir [GLYPHDIR]
Path to glyphs to be used for patching
--makegroups [{-1,0,1,2,3,4,5,6}]
Use alternative method to name patched fonts (recommended)
--variable-width-glyphs
Do not adjust advance width (no "overhang")
--has-no-italic Font family does not have Italic (but Oblique)
--progressbars Show percentage completion progress bars per Glyph Set (default)
--no-progressbars Don't show percentage completion progress bars per Glyph Set
--debug [{0,1,2,3}] Verbose mode (optional: 1=just to file; 2*=just to terminal; 3=display and file)
--dry Do neither patch nor store the font, to check naming
--xavgcharwidth [XAVGWIDTH]
Adjust xAvgCharWidth (optional: concrete value)
Symbol Fonts:
--fontawesome Add Font Awesome Glyphs (http://fontawesome.io/)
--fontawesomeextension
Add Font Awesome Extension Glyphs (https://andrelzgava.github.io/font-awesome-extension/)
--fontlogos, --fontlinux
Add Font Logos Glyphs (https://github.com/Lukas-W/font-logos)
--octicons Add Octicons Glyphs (https://octicons.github.com)
--codicons Add Codicons Glyphs (https://github.com/microsoft/vscode-codicons)
--powersymbols Add IEC Power Symbols (https://unicodepowersymbol.com/)
--pomicons Add Pomicon Glyphs (https://github.com/gabrielelana/pomicons)
--powerline Add Powerline Glyphs
--powerlineextra Add Powerline Glyphs (https://github.com/ryanoasis/powerline-extra-symbols)
--material, --materialdesignicons, --mdi
Add Material Design Icons (https://github.com/templarian/MaterialDesign)
--weather, --weathericons
Add Weather Icons (https://github.com/erikflowers/weather-icons)
例子
./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf
./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf -s -q
./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf --use-single-width-glyphs --quiet
./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf -w
./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf --windows --quiet
./font-patcher Droid\ Sans\ Mono\ for\ Powerline.otf --windows --pomicons --quiet
./font-patcher Inconsolata.otf --fontawesome
./font-patcher Inconsolata.otf --fontawesome --octicons --pomicons
./font-patcher Inconsolata.otf
Gotta Patch 'em All Font Patcher!
-
针对贡献者和开发者使用
-
在未打包的路径中re-patches 所有 字体:
./gotta-patch-em-all-font-patcher\!.sh
- 可以选择限制到特定字体名称模式:
./gotta-patch-em-all-font-patcher\!.sh Hermit
贡献
See contributing.md
不稳定的文件路径
⚠️ 警告: 基于后续的新版本发布,文件路径有可能被改变 (特别是 major version bumps)
注意 release 分支 不是 master分支因为路径会因为新版本发布而改变
- 举例:
- ✅ Use:
https://github.com/ryanoasis/nerd-fonts/blob/0.9.0/patched-fonts/Hermit/Medium/complete/Hurmit%20Medium%20Nerd%20Font%20Complete.otf
- ❌ Instead of:
https://github.com/ryanoasis/nerd-fonts/blob/
master/patched-fonts/Hermit/Medium/complete/Hurmit%20Medium%20Nerd%20Font%20Complete.otf
- ✅ Use:
其他的好字体
- 一个包含更多好字体的列表,可惜的是,因为许可问题我们不能提供或分享它们:
- Input Mono (license restriction)
- Possibly coming with external hosting :)
- PragmataPro (not free)
- Consolas (proprietary)
项目目的
更新日志
See changelog.md
许可
MIT © Ryan L McIntyre