1
0
mirror of https://github.com/ryanoasis/nerd-fonts.git synced 2024-11-19 16:39:20 +02:00
nerd-fonts/readme_cn.md
Fini Jastrow 0e3e1c8c3e doc: Fix Homebrew in readme translations
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2024-05-19 15:55:52 +02:00

34 KiB

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对字形进行搜索

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 w m2 l
[Agave][p-agave] [Agave][f-agave] 37 NO w m2 l
AnonymicePro Nerd Font Anonymous Pro 1.002 YES w m2 l
[Arimo][p-arimo] [Arimo][f-arimo] 1.33 NO w m2 l
Aurulent Sans Mono Nerd Font Stephen G. Hartke NO w m2 l
[BigBlueTerminal][p-bigblueterm] VileR NO w m2 l
Bitstrom Wera Nerd Font Bitstream Inc 1.1 YES w m2 l
[Blex Mono][p-blex] [IBM Plex Mono][f-ibm-plex] 2.3 YES w m2 l
[Caskaydia Cove Nerd Font][p-cascadia] [Cascadia Code][f-cascadia] 2111.01 YES w m2 l
Code New Roman Nerd Font Sam Radian 2.0 NO w m2 l
[Comic Shanns Mono Nerd Font][p-comic] [Comic Shanns Mono][f-comic] 1.3 NO w m2 l
[Cousine Nerd Font][p-cousine] [Cousine][f-cousine] 1.211 NO w m2 l
[DaddyTimeMono][p-daddytimemono] [DaddyTimeMono][f-daddytimemono] 1.2.3 NO w m2 l
DejaVu Sans Mono Nerd Font [DejaVu][f-dejavu] 2.37 NO w m2 l
Droid Sans Mono Nerd Font Ascender Corp 1.00-113 NO w m2 l
Fantasque Sans Nerd Font Fantasque Sans 1.8.0 NO w m2 l
Fira Code Nerd Font Fira Code 6.2 NO w m2 l
Fira Mono Nerd Font Fira 3.206 NO w m2 l
[Go Mono Nerd Font][p-go-mono] [Go-Mono][f-go-mono] 2.010 NO w m2 l
Gohu Nerd Font [Gohu TTF][f-gohu2],Gohu 2.0 NO w m2 l
Hack Nerd Font Hack 3.003 NO w m2 l
Hasklug Nerd Font Hasklig 1.2 YES w m2 l
Heavy Data Mono Nerd Font Vic Fieger 1 NO w m2 l
Hurmit Nerd Font [Hermit][f-hermit] 2.0 YES w m2 l
[iM-Writing][p-im-writing] [iA-Writer][f-ia-writer] Dec 2018 YES w m2 l
Inconsolata Nerd Font [Inconsolata][f-inconsolata] 3.000 NO w m2 l
Inconsolata Go Nerd Font [InconsolataGo][f-inconsolatago] 1.013 NO w m2 l
[Inconsolata LGC Nerd Font][p-inconsolata-lgc] [Inconsolata LGC][f-inconsolatalgc] 1.3 NO w m2 l
Iosevka Nerd Font Iosevka 22.1.0 NO w m2 l
[Iosevka Term Nerd Font][p-iosevka-term] Iosevka Term 22.1.0 NO w m2 l
JetBrains Mono JetBrains Mono 2.304 NO w m2 l
Lekton Nerd Font [Lekton][f-lekton] 34 NO w m2 l
Literation Mono Nerd Font Liberation 2.1.5 YES w m2 l
[Lilex Nerd Font][p-lilex] [Lilex][f-lilex] 2.300 NO w2 m2 l
Meslo Nerd Font [Meslo][f-meslo] 1.21 NO w m2 l
Monofur Nerd Font Tobias B Koehler 1.0 NO w m2 l
Monoid Nerd Font Monoid 0.61 NO w m2 l
Mononoki Nerd Font Mononoki 1.6 YES w m2 l
M+ (MPlus) Nerd Font [M+ Fonts][f-mplus] 2023/03 NO w m2 l
[Noto][p-noto] [Noto][f-noto] div NO w m2 l
[OpenDyslexic][p-opendyslexic] [OpenDyslexic][f-opendyslexic] 2.001 NO w m2 l
[Overpass][p-overpass] [Overpass][f-overpass] 3.0.5 NO w m2 l
ProFont (Windows tweaked) Nerd Font [ProFont][f-profont] 2.3 NO w m2 l
ProFont (x11) Nerd Font [ProFont][f-profont] 2.2 NO w m2 l
ProggyClean Nerd Font Tristan Grimmer 2004/04/15 NO Imperfect
Roboto Mono [Roboto Mono][f-roboto] 3.0 NO w m2 l
Sauce Code Nerd Font Source 2.038 YES w m2 l
Shure Tech Mono Nerd Font Share Tech Mono 1.003 YES w m2 l
Space Mono Nerd Font Space Mono 1.001 NO w m2 l
Terminess Nerd Font Terminus TTF 4.49.2 YES w m2 l
[Tinos][p-tinos] [Tinos][f-tinos] 1.23 NO w m2 l
Ubuntu Nerd Font [Ubuntu Font][f-ubuntu] 0.83 NO w m2 l
Ubuntu Mono Nerd Font [Ubuntu Font][f-ubuntu] 0.80 NO w m2 l
[Victor Mono][p-victor] [Victor Mono][f-victor] 1.5.4 NO w m2 l

*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

字体安装

选项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的情况
  • 你需要复制已经生成好的字体到你系统中正确的字体文件夹中

Nerd Fonts Patcher

可以通过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

其他的好字体

  • 一个包含更多好字体的列表,可惜的是,因为许可问题我们不能提供或分享它们:
  • 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