Skip to content

Latest commit

 

History

History
623 lines (461 loc) · 32.7 KB

readme_cn.md

File metadata and controls

623 lines (461 loc) · 32.7 KB

Nerd Fonts Logo

GitHub release Gitter CodeClimate Code of Conduct PRs Welcome   Windows Logo   macOS (OSX) Logo   Linux Logo

Nerd Fonts 是一个使用大量字体图标来解决程序员在开发过程中缺少合适字体的问题的项目。它可以从流行的字体图标库中将大量外部字体引入待开发的项目中,它支持的字体图标库包括 Font Awesome ➶, Devicons ➶, Octicons ➶, and others.

下面的桑基图展示了Nerd Fonts中现有的字形组合:

@SankeyMATIC Diagram

创建图表的工具为: @SankeyMATIC

快速导航

Latest Release ➶ Fonts Patcher VimDevIcons ➶ Font Package
Downloads ➶
fonts-logo-small fonts-logo-small patcher-logo-small vim-devicons-logo-small fonts-logo-small

重要提示

目录

TL;DR

安装选项

特征

开发者 / 贡献者

项目的目的

附加信息

TL;DR

Nerd Fonts 中包含流行的程序字体和字形。 如果你想要的字体没有在现有的字体库中,你可以使用 font patcher来自定义字体。 更多信息请见 wiki。如果你正在寻找Vim插件,请见 VimDevIcons ➶

多种字体下载选项

如果你...

特征

字形集

🔍 🔍 你现在可以通过NerdFonts.com中的Cheat Sheet对字形进行搜索

Seti-UI + 自定义

基于 Seti-UI Icomoon 的额外自定义字形。

image

一个为开发者,code jedis,ninjas,HTTPsters,evangelists 和 nerds(sic)制作的图标字体。 / (repo) / (website)

image

字体图标和 CSS 工具包。 / (repo) / (website)

image image image image

简单的 Font Awesome 补充包。 / (repo) / (website)

image

GitHub's 图标. / (repo) / (website)

Nerd Font Complete Codepoints:*

image

* To avoid conflicts between icon sets, these were modified in the 'Complete' fonts. To view the original codepoints see the Wiki.

提供额外的 Powerline separator 字体 和 a column number glyph (CN). / (repo)

image

向Unicode中加入新字符 / (website)

image image

Font-linux 是一个包含LOGO和linux流行布局的图标字体。 / (repo)

image

8 个符号 "Pomodoro Technique"®. / (repo)

image

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_linux.sh - Font Linux (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 Linux), but other sets should work with their standard fonts too.

字体补丁

Font Name Font Name and Repository *RFN EM Size Status
3270 Nerd Font 3270 NO 1000 w2 m2 l2
Anonymice Nerd Font Anonymous Pro NO 2048 w m2 l
Aurulent Sans Mono Nerd Font NO 1000 w m2 l
Bitstream Vera Sans Mono Nerd Font NO 2048 w m2 l
Code New Roman Nerd Font NO 2048 w m2 l
DejaVu Sans Mono Nerd Font NO 2048 w m2 l
Droid Sans Mono Nerd Font NO 2048 w m2 l
Fantasque Sans Nerd Font Fantasque Sans NO 2048 w m2 l
Fura Code Nerd Font Fira YES 1000 w m2 l
Fura Mono Nerd Font Fira YES 1000 w m2 l
Gohu Nerd Font Gohu NO 1000 w2 m2 l2
Hasklug Nerd Font Hasklig YES 1000 w m2 l
Heavy Data Mono Nerd Font NO 2048 w m2 l
Hermut Nerd Font NO 1000 w m2 l
Inconsolata Nerd Font NO 1000 w m2 l
Inconsolata Go Nerd Font NO 1000 w m2 l
Iosevka Nerd Font Iosevka YES 1000 #83
Knack Nerd Font Hack YES 2048 w m2 l
Lekton Nerd Font NO 1000 w m2 l
Literation Mono Nerd Font Liberation YES 2048 w m2 l
Meslo Nerd Font NO 2048 w m2 l
Monofur Nerd Font NO 2400 w m2 l
Monoid Nerd Font NO 1536 w m2 l
Mononoki Nerd Font Mononoki NO 1024 w m2 l
M+ (MPlus) Nerd Font NO 1000 w m2 l
ProFont (Windows tweaked) Nerd Font NO 1200 w m2 l
ProFont (x11) Nerd Font NO 1000 [FAILING]
ProggyClean Nerd Font NO 2048 [FAILING]
Roboto Mono NO 2048 [FAILING]
Sauce Code Nerd Font Source YES 1000 w m2 l
Shure Tech Mono Nerd Font Share Tech Mono YES 1000 w m2 l
Space Mono Nerd Font Space Mono NO 1000 w m2 l
Terminess Nerd Font Terminus Font YES 1000 w m2 l
Ubuntu Nerd Font NO 1000 w m2 l
Ubuntu Mono Nerd Font NO 1000 w m2 l

*RFN = Reserved Font Name

字体集

  • 超过 87,000个 独立的 变化/组合(Power Set)字体包:
    • 39个 字体合集
    • 169个 字体家族
    • 676个 ‘完全’的 变化/组合字体
    • 86,702个 有可能的 变化/组合字体
    • 87,378个 总字体数 (676 + 86,702)
  • 每种字体的组合都是任意 Variations的组合

Variations

字体安装

选项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 tap caskroom/fonts
brew cask 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/master/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/master/patched-fonts/DroidSansMono/complete/Droid%20Sans%20Mono%20Nerd%20Font%20Complete.otf

选项7: 非官方 Arch User Repository (AUR)

适用于 Arch Linux 下使用 AUR packages的情况

下列字体可以在Arch Linux通过 AUR packages 下载:

选项8: 打包你的个人字体

适用于 patching 你的 个人字体 或者深度 自定义 字体补丁。

在你的个人字体中使用 Python 命令行脚本去增加新的字形并生成字体包

请见: Font Patcher 的使用方法

  • 这个选项适用于当你 不想 使用 fonts provided的情况
  • 你需要复制已经生成好的字体到你系统中正确的字体文件夹中

Nerd Fonts Patcher

可以通过VimDevIcons ➶打包你选中的字体:

  • 需要: Python 2 (or 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
usage: font-patcher [-h] [-v] [-s] [-l] [-q] [-w] [-c] [--fontawesome]
                    [--fontawesomeextension] [--fontlinux] [--octicons]
                    [--powersymbols] [--pomicons] [--powerline]
                    [--powerlineextra] [--custom [CUSTOM]]
                    [--postprocess [POSTPROCESS]]
                    [--progressbars | --no-progressbars] [--careful]
                    [-ext [EXTENSION]] [-out [OUTPUTDIR]]
                    font

Nerd Fonts Font Patcher: patches a given font with programming and development related glyphs

* Website: https://www.nerdfonts.com
* Version: 1.2.0
* Development Website: https://github.com/ryanoasis/nerd-fonts
* Changelog: https://github.com/ryanoasis/nerd-fonts/blob/master/changelog.md

positional arguments:
  font                  The path to the font to patch (e.g., Inconsolata.otf)

optional arguments:
  -h, --help            显示帮助信息和退出
  -v, --version         显示程序版本号和退出
  -s, --mono, --use-single-width-glyphs
                        设置生成的字体是single-width还是double-width (默认是 double-width)
  -l, --adjust-line-height
                        设置是否调整 line heights (一般应该尝试 center powerline separators)
  -q, --quiet, --shutup
                        不生成 verbose output
  -w, --windows         将内部字体名称限制在31个字符内 (为了 Windows 兼容性)
  -c, --complete        加入所有可用的字体
  --fontawesome         加入 Font Awesome Glyphs字体 (http://fontawesome.io/)
  --fontawesomeextension
                        加入 Font Awesome 补充字体 (https://andrelzgava.github.io/font-awesome-extension/)
  --fontlinux           加入 Font Linux 字体 (https://github.com/Lukas-W/font-linux)
  --octicons            加入 Octicons 字体 (https://octicons.github.com)
  --powersymbols        加入 IEC Power Symbols (https://unicodepowersymbol.com/)
  --pomicons            加入 Pomicon 字体 (https://github.com/gabrielelana/pomicons)
  --powerline           加入 Powerline 字体
  --powerlineextra      加入 Powerline 字体 (https://github.com/ryanoasis/powerline-extra-symbols)
  --custom [CUSTOM]     指定一个自定义图标字体,所有新字形都会在不缩放的情况下被拷贝。
  --postprocess [POSTPROCESS]
                        指定一个针对后续进程的脚本
  --progressbars        显示每个Glyph Set的完成度进度条
  --no-progressbars     不显示每个Glyph Set的完成度进度条
  --careful             如果发现了已经存在的字形,不要对它进行复写
  -ext [EXTENSION], --extension [EXTENSION]
                        更改字体文件的文件格式去创建新文件 (e.g., ttf, otf)
  -out [OUTPUTDIR], --outputdir [OUTPUTDIR]
                        将修补后的字体文件输出到特定目录

例子

./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

其他的好字体

  • 一个包含更多好字体的列表,可惜的是,因为许可问题我们不能提供或分享它们:
  • Input Mono (license restriction)
    • Possibly coming with external hosting :)
  • PragmataPro (not free)
  • Consolas (proprietary)

项目目的

See Wiki: Project Purpose

更新日志

See changelog.md

许可

MIT © Ryan L McIntyre