nerd-fonts/readme_tw.md
Fini Jastrow b82bd819aa Remove mentions of master branch [skip ci]
[why]
If we ever switch the default branch the links would break. So just say
'default branch' directly, whichever that may be.

[note]
CI workflows not changed, I do not know if there is an alias for the
default branch available.

Fixes: #971 (partially)

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2022-10-17 11:50:53 +02:00

43 KiB
Raw Blame History

Nerd Fonts Logo

Iconic font aggregator, collection, and patcher

Releases   |   Fonts   |   Font Patcher   |   Wiki Documentation   |   Stickers   |   VimDevIcons

GitHub release Gitter Build Status Code of Conduct PRs Welcome Nerd Fonts - OS Support Twitter

Nerd Fonts 是一個使用大量字體圖示來解決程式設計師在開發過程中缺少合適字體的問題的專案。它可以從流行的字體圖示庫中將大量外部字體引入待開發的專案中,它支持的字體圖示庫包括 Font Awesome ➶, Devicons ➶, Octicons ➶, and others.

下面的桑基圖Sankey Diagram展示了 Nerd Fonts 中現有的字形組合:

@SankeyMATIC Diagram

創建圖表的工具為: @SankeyMATIC

重要提示

目錄

TL;DR

安裝選項

特徵

開發者 / 貢獻者

專案目的

附錄

TL;DR

Nerd Fonts 中包含流行的程式字體和字形。 如果你想要的字體沒有在現有的字體庫中,你可以使用 font patcher來自訂字體。 更多信息請見 wiki。如果你正在尋找 Vim 外掛,請見 VimDevIcons ➶

多種字體下載選項

如果你...

特徵

字形集

🔍 🔍 你現在可以透過 NerdFonts.com 中的 Cheat Sheet 對字形進行搜索

請見 Wiki: Glyph Sets and Codepoints for more details

Shell 中的 Icon 名稱

請見 Wiki: Icon names in shell

字體包

Font Name Font Name and Repository *RFN EM Size Status
3270 Nerd Font 3270 NO 1000 w m2 l
Agave Agave NO 2048 w m2 l
Anonymice Nerd Font Anonymous Pro NO 2048 w m2 l
Arimo Arimo NO 2048 w m2 l
Aurulent Sans Mono Nerd Font NO 1000 w m2 l
BigBlueTerminal NO 1200 w m2 l
Bitstream Vera Sans Mono Nerd Font NO 2048 w m2 l
Blex* IBM Plex Mono YES 1000 w m2 l
Caskaydia Cove Nerd Font* Cascadia Code YES 2048 w m2 l
Code New Roman Nerd Font NO 2048 w m2 l
Cousine Nerd Font Cousine NO 1000 w m2 l
DaddyTimeMono DaddyTimeMono NO 1024 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
Fira Code Nerd Font Fira Code NO 1000 w m2 l
Fira Mono Nerd Font Fira NO 1000 w m2 l
Go Mono Nerd Font Go-Mono NO 1000 w m2 l
Gohu Nerd Font Gohu TTF,Gohu NO 1000 w m2 l
Hack Nerd Font Hack NO 2048 w m2 l
Hasklug Nerd Font* Hasklig YES 1000 w m2 l
Heavy Data Mono Nerd Font NO 2048 w m2 l
Hurmit Nerd Font NO 1000 w m2 l
iM-Writing* iA-Writer YES 1000 w m2 l
Inconsolata Nerd Font NO 1000 w m2 l
Inconsolata Go Nerd Font NO 1000 w m2 l
Inconsolata LGC Nerd Font NO 1000 w m2 l
Iosevka Nerd Font Iosevka NO 1000 #83
JetBrains Mono JetBrains Mono NO 1000 w m2 l
Lekton Nerd Font NO 1000 w m2 l
Literation Mono Nerd Font* Liberation YES 2048 w m2 l
Lilex Nerd Font Lilex NO 2000 w2 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
Noto NO 1000 w m2 l
OpenDyslexic NO 1000 w m2 l
Overpass NO 1000 w m2 l
ProFont (Windows tweaked) Nerd Font NO 1200 w m2 l
ProFont (x11) Nerd Font NO 1000 w m2 l
ProggyClean Nerd Font NO 2048 Imperfect
Roboto Mono NO 2048 w m2 l
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
Tinos NO 2048 w m2 l
Ubuntu Nerd Font NO 1000 w m2 l
Ubuntu Mono Nerd Font NO 1000 w m2 l
Victor Mono Victor Mono NO 1000 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,485,410)
  • 每種字體的組合都是任意 Variations 的組合

Variations

字體安裝

選項1: 手動下載並安裝

安裝特定 單獨字體最快方法。

下載你選中的特定字體 patched font

選項2: 下載發佈存檔

適用於當你需要archive或者完整的字體家族(Bold, Italic, etc.)的情況。

你可以以壓縮檔的形式從 latest r elease下載所需的字體

選項3: 腳本安裝

適用於當你想要 自動 安裝或者使用 scripts 的情況。

: Requires cloning the repo as of now

所有字體:

  • 安裝全部的字體包 (警告:字體的數量眾多,需要下載的文件體積巨大)
./install.sh

或是在 Powershell (僅限 Windows)

./install.ps1

單獨字體:

  • 安裝你所需的單獨字體
./install.sh <FontName>
./install.sh Hack
./install.sh HeavyData

或是在 Powershell (僅限 Windows):

./install.ps1 <FontName>
./install.ps1 Hack
./install.ps1 HeavyData
./install.ps1 FiraCode, Hack
./install.ps1 CascadiaCode -WindowsCompatibleOnly
./install.ps1 DejaVuSansMono -WhatIf

選項4: Homebrew 字體

適用於 macOS 系統Homebrew使用者。

所有字體都可以透過 Homebrew 字體 從 macOS (OS X)平台上找到

brew tap caskroom/fonts
brew install --cask font-hack-nerd-font

選項5: 複製 Repo

適用於要使用 完全控制, 所有 或者 多數 字體的情況,或者為 Nerd Fonts 的開發 盡一份力的情況。

基於效率考慮,如果你只想使用有限的幾種字體,我們不推薦複製這個 repository。

但是如果你想要複製這個 repo請確認你shallow複製了它:

git clone --depth 1

如果你想要複製一個子目錄,使用 git sparse-checkout。以下指令至少需要 Git v2.26

git clone --filter=blob:none --sparse git@github.com:ryanoasis/nerd-fonts
cd nerd-fonts
git sparse-checkout add patched-fonts/JetBrainsMono

選項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/-/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/-/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
  • Linux 上的替代安裝方法: 使用 AppImage
  • Docker 上的替代安裝方法: Docker Hub
  • 使用:

    ./font-patcher PATH_TO_FONT
    
  • 替代方案: 使用 script flag 透過 FontForge binary 來執行打包:

    ./fontforge -script font-patcher PATH_TO_FONT
    
  • 使用 AppImage:

    : 下載 AppImage 後需執行 chmod u+x 指令. 所有路徑皆需使用絕對路徑,並且需要明確的輸出路徑! 如果所有內容都在同一個目錄下, 你可以使用 $PWD.

    ./FontForge.AppImage -script $PWD/font-patcher $PWD/BaseFont.ttf -out /tmp
    
  • 使用 Docker:

    docker run -v /path/to/fonts:/in -v /path/for/output:/out nerdfonts/patcher [OPTIONS]
    

完整選項:

usage: font-patcher [-h] [-v] [-s] [-l] [-q] [-w] [-c] [--careful]
                    [--removeligs] [--postprocess [POSTPROCESS]]
                    [--configfile [CONFIGFILE]] [--custom [CUSTOM]]
                    [-ext [EXTENSION]] [-out [OUTPUTDIR]]
                    [--glyphdir [GLYPHDIR]] [--makegroups]
                    [--variable-width-glyphs]
                    [--progressbars | --no-progressbars] [--also-windows]
                    [--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: 2.2.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)

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        加入所有可用的字體
  --careful             如果發現了已經存在的字形,不要對它進行覆寫
  --removeligs, --removeligatures
                        Removes ligatures specificed in JSON configuration file
  --postprocess [POSTPROCESS]
                        指定一個針對後續處理程式的腳本
  --configfile [CONFIGFILE]
                        Specify a file path for JSON configuration file (see sample: src/config.sample.json)
  --custom [CUSTOM]     指定一個自訂圖示字體,所有新字形都會在不縮放的情況下被複製。
  -ext [EXTENSION], --extension [EXTENSION]
                        更改字體文件的文件格式去創建新文件 (e.g., ttf, otf)
  -out [OUTPUTDIR], --outputdir [OUTPUTDIR]
                        將修補後的字體文件輸出到特定目錄
  --glyphdir [GLYPHDIR]
                        Path to glyphs to be used for patching
  --makegroups          Use alternative method to name patched fonts (experimental)
  --variable-width-glyphs
                        Do not adjust advance width (no "overhang")
  --progressbars        顯示每個Glyph Set的完成度進度條
  --no-progressbars     不顯示每個Glyph Set的完成度進度條
  --also-windows        Create two fonts, the normal and the --windows version

Symbol Fonts:
  --fontawesome         加入 Font Awesome Glyphs字體 (http://fontawesome.io/)
  --fontawesomeextension
                        加入 Font Awesome 補充字體 (https://andrelzgava.github.io/font-awesome-extension/)
  --fontlogos, --fontlinux
                        加入 Font Logos 字體 (https://github.com/Lukas-W/font-logos)
  --octicons            加入 Octicons 字體 (https://octicons.github.com)
  --codicons            Add Codicons Glyphs (https://github.com/microsoft/vscode-codicons)
  --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)
  --material, --materialdesignicons, --mdi
                        加入 Material Design 字體 (https://github.com/templarian/MaterialDesign)
  --weather, --weathericons
                        加入 Weather 字體 (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

./FontForge.AppImage -script /tmp/nerdfonts/font-patcher /tmp/nerdfonts/CascadiaMonoPL-Semibold.ttf --fontawesome -out /tmp
./FontForge.AppImage -script $PWD/font-patcher $PWD/CascadiaMonoPL-Semibold.ttf --octicons -out $HOME

docker run --rm -v ~/myfont/patchme:/in -v ~/myfont/patched:/out nerdfonts/patcher
docker run --rm -v ~/Desktop/myfont/patchme:/in -v ~/Desktop/myfont/patched:/out nerdfonts/patcher --fontawesome

Gotta Patch 'em All Font Patcher!

  • 針對貢獻者和開發者使用

  • 在未打包的路徑中 re-patches 所有 字體:

    ./gotta-patch-em-all-font-patcher\!.sh
    
  • 可以選擇限制到特定字體名稱模式:

    ./gotta-patch-em-all-font-patcher\!.sh Hermit
    

貢獻

請見 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

其他的好字體

一個包含更多好字體的列表,可惜的是,因為授權問題我們不能提供或分享它們:

專案目的

請見 Wiki: Project Purpose

更新日誌

請見 changelog.md

授權

請見 LICENSE