1
0
Fork 0
mirror of synced 2024-05-05 13:13:27 +12:00
FiraCode/README_CN.md
墨抒颖 0d88d99bb1 Create README_CN.md
加入中文翻译
2021-12-20 12:57:15 +01:00

10 KiB
Raw Blame History

Fira Code字体是一种适用于编程的等宽字体。使用它可以减少我们在编程时处理逻辑标记的脑力消耗。

Fira Code

问题

开发者们使用的多标记,通常都是用几个字符编码。对于人的大脑来说,像-><=:=这样的序列是单一的逻辑标记即使它们在屏幕上显示两到三个字符。您的眼睛并非无消耗的来扫描、解析并将多个字符连接到一个逻辑字符中。理想情况下所有编程语言都应该为操作符设计成熟的Unicode符号但现在还不是这样。

方案

Fira Code是一种免费的等宽字体包含常用的编程语言中多种字符组合的连字。这只是一个字体呈现功能底层代码仍然与ASCII兼容。这有助于更快地阅读和理解代码。对于一些常见的序列..//,连字允许我们纠正间距。

下载和安装

Fira_Code_v6.2.zip - December 6, 2021 - 2.5 MB

下一步:

Support

Sponsor

Fira Code 是一个个人项目,没有资金和巨大的空闲时间项目 feature request backlog. 如果你也热爱这个项目, 考虑通过以下途径支持其发展 GitHub SponsorsPatreon. 任何帮助都是有价值的!

字体里都有哪些特征?

左侧Fira Code中呈现的连字。右侧没有连字的相同字符序列。

Fira Code 带有种类繁多的箭头。更棒的是:您可以随心所欲地制作它们,并根据需要组合开始/中间/结束片段!

Fira Code 不仅与连字有关,还对标点符号和频繁的字母对进行了一些微调。

Fira Code 附带了几个不同的字符变体,以便每个人都可以选择最适合自己的. How to enable

可以使用样式集/字符变体更改或启用某些连字:

作为一种编程字体Fira Code 对 ASCII/框绘图、电力线和其他形式的控制台 UI 具有出色的支持:

Fira Code 是第一个提供专用字形来渲染进度条的编程字体:

在不断更新的进度条中:

我们希望更多的编程字体能够采用这个约定并发布自己的版本。

Unicode 覆盖使 Fira Code 成为数学写作的绝佳选择:

它看起来怎样?

编辑器兼容性列表

Works Doesnt work
Abricotine Arduino IDE
Android Studio (2.3+, instructions) Adobe Dreamweaver
Anjuta (unless at the EOF) Delphi IDE
AppCode (2016.2+, instructions) Standalone Emacs (workaround)
Atom 1.1 or newer (instructions) Godot (issue)
BBEdit/TextWrangler (v. 11 only, instructions) IDLE
Brackets (with this plugin) KDevelop 4
Chocolat Monkey Studio IDE
CLion (2016.2+, instructions) UltraEdit
Cloud9 (instructions)
Coda 2
CodeLite
CodeRunner
CotEditor
Eclipse
elementary Code
Geany (1.37+)
gEdit / Pluma
GNOME Builder
GoormIDE (instructions)
gVim (Windows, GTK)
IntelliJ IDEA (2016.2+, instructions)
Kate, KWrite
KDevelop 5+
Komodo
Leafpad
LibreOffice
LightTable (instructions)
LINQPad
MacVim 7.4 or newer (instructions)
Mancy
MATLAB (instructions)
Meld
Mousepad
NeoVim-gtk
NetBeans
Notepad (Windows)
Notepad++ (with a workaround)
Notepad3 (instructions)
Nova
PhpStorm (2016.2+, instructions)
PyCharm (2016.2+, instructions)
QOwnNotes (21.16.6+)
QtCreator
Rider
RStudio (instructions)
RubyMine (2016.2+, instructions)
Scratch
Scribus (1.5.3+)
SublimeText (3146+)
Spyder IDE (only with Qt5)
SuperCollider 3
TextAdept (Linux, macOS)
TextEdit
TextMate 2
VimR (instructions)
Visual Studio (2015+, instructions)
Visual Studio Code (instructions)
WebStorm (2016.2+, instructions)
Xamarin Studio/Monodevelop
Xcode (8.0+, otherwise with plugin)
Xi
Probably work: Smultron, Vico Under question: Code::Blocks IDE

终端兼容性列表

Platform Works Doesnt work
macOS Hyper (see #3607)
iTerm 2
Kitty
Terminal.app
ZOC
Alacritty
Windows Hyper (see #3607)
Mintty
Token2Shell
Windows Terminal
Alacritty
Cmder
ConEmu
PuTTY
Windows Console
ZOC
Linux Hyper (see #3607)
Kitty
Konsole
QTerminal
Termux
st (patch)
Alacritty
GNOME Terminal
libvte-based terminals (bug report):
  • gtkterm
  • guake
  • LXTerminal
  • sakura
  • Terminator
  • xfce4-terminal
mate-terminal
rxvt
terminology
xterm
ChromeOS crosh (instructions)

在浏览器中使用

<!-- HTML -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/firacode@6.2.0/distr/fira_code.css">
/* CSS */
@import url(https://cdn.jsdelivr.net/npm/firacode@6.2.0/distr/fira_code.css);
/* Specify in CSS */
code { font-family: 'Fira Code', monospace; }

@supports (font-variation-settings: normal) {
  code { font-family: 'Fira Code VF', monospace; }
}
  • IE 10+, Edge Legacy: enable with font-feature-settings: "calt";
  • Firefox
  • Safari
  • Chromium-based browsers (Chrome, Opera)
  • ACE
  • CodeMirror (enable with font-variant-ligatures: contextual;)

正在使用 Fira Code的项目

备选方案

带连字的免费等宽字体:

带连字的付费等宽字体:

在本地构建 Fira Code

如果您想更改 FiraCode.glyphs 并自己构建 OTF / TTF / WOFF 文件,这是我在 macOS 上使用的设置:

# install all required build tools
./script/bootstrap_macos.sh

# build the font files
./script/build.sh

# install OTFs to ~/Library/Fonts
cp distr/otf/*.otf ~/Library/Fonts

Alternatively, you can build Fira Code using Docker:

# install dependencies in a container and build the font files
make

# package the font files from dist/ into a zip
make package

制作人员