[Translated] 20171117 5 open source fonts ideal for programmers.md

Signed-off-by: Chang Liu <liuchang011235@163.com>
This commit is contained in:
Chang Liu 2019-04-14 11:03:46 +08:00
parent e19ba90e8f
commit 931faba84f
2 changed files with 87 additions and 134 deletions

View File

@ -1,134 +0,0 @@
FSSlc translating
5 open source fonts ideal for programmers
======
![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/documentation-type-keys-yearbook.png?itok=Q-ELM2rn)
What is the best programming font? First, you need to consider that not all fonts are created equally. When choosing a font for casual reading, the reader expects the letters to smoothly flow into one another, giving an easy and enjoyable experience. A single character for a standard font is akin to puzzle piece designed to carefully mesh with every other part of the overall typeface.
When writing code, however, your font requirements are typically more functional in nature. This is why most programmers prefer to use monospaced fonts with fixed-width letters, when given the option. Selecting a font that has distinguishable numbers and punctuation, is aesthetically pleasing, and has a copyright license that meets your needs is also important.
There are certain features that make a font optimal for programming. First, a detailed definition of what makes a monospaced font is in order. Consider the letter "w" as it compares to the letter "i" for a moment. When you are dealing with a font, it is important to think about the whitespace around the letter, as well as the letter itself. In the world of physical books and newspapers, where efficient use of space is often critical, it makes sense to assign less width to the thin "i" than the wide "w."
There are certain features that make a font optimal for programming.
Inside a terminal, however, you are blessed with no such restrictions, and it can be very useful for every character to share an identical amount of space. The main functional benefit is that you can effectively "guesstimate" how long your code is by casually glancing at a block of text. Secondary benefits include the ability to align characters and punctuation easily, highlighting is much more visually obvious, and optical character recognition on printed sheets is more effective for monospaced fonts than proportional fonts.
Inside a terminal, however, you are blessed with no such restrictions, and it can be very useful for every character to share an identical amount of space. The main functional benefit is that you can effectively "guesstimate" how long your code is by casually glancing at a block of text. Secondary benefits include the ability to align characters and punctuation easily, highlighting is much more visually obvious, and optical character recognition on printed sheets is more effective for monospaced fonts than proportional fonts.
In this article we will explore five excellent open source font options that are ideal for programming and writing code.
### 1. Firacode: The best overall programming font
### [firacode.png][1]
![FiraCode example][2]
FiraCode, Andrew Lekashman
### [firacode2.png][3]
![FiraCode compared to Fira Mono][4]
FiraCode compared to Fira Mono, [Nikita Prokopov][5] via GitHub
### 2. Inconsolata: Elegant and created by a brilliant designer
### [inconsolata.png][6]
![Inconsolata example][7]
Inconsolata, Andrew Lekashman
The first font on our list is [FiraCode][5] , a programming font that truly goes above and beyond the call of duty. FiraCode is an extension of Fira, the open source font family commissioned by Mozilla. What makes FiraCode different is that it modifies the common symbol combinations or ligatures used in code to be extraordinarily readable. This font family comes in several styles, notably including a Retina option. You can find examples for how it applies to many programming languages on its [GitHub][5] page.
[Inconsolata][8] is one of the most beautiful monospaced fonts. It has been around since 2006 as an open source and freely available option. The creator, Raph Levien designed Inconsolata with one basic statement in mind: "monospaced fonts do not have to suck." Two things that stand out about Inconsolata are its extremely clear differences between 0 and O and its well-defined punctuation.
### 3. DejaVu Sans Mono: Standard issue with many Linux distros and huge glyph coverage
### [dejavu_sans_mono.png][9]
![DejaVu Sans Mono example][10]
DejaVu Sans Mono, Andrew Lekashman
Inspired by the copyrighted and closed Vera font family used in GNOME, [DejaVu Sans Mono][11] is an extremely popular programming font that comes bundled with nearly every modern Linux distribution. DejaVu comes packed with a whopping 3,310 glyphs under the Book Variant, compared to a standard font, which normally rests easy at around 100 glyphs. You'll have no shortage of characters to work with, it has enormous coverage over Unicode, and it is actively growing all of the time.
### 4. Source Code Pro: Elegant and readable, created by a small, talented team at Adobe
### [source_code_pro.png][12]
![Source Code Pro example][13]
Source Code Pro, Andrew Lekashman
Designed by Paul Hunt and Teo Tuominen, [Source Code Pro][14] was [produced by Adobe][15] to be one of its first open source fonts. Source Code Pro is notable in that it is extremely readable and has excellent differentiation between potentially confusing characters and punctuation. Source Code Pro is also a font family and comes in seven different styles: Extralight, Light, Regular, Medium, Semibold, Bold, and Black, with italic variants of each.
### [source_code_pro2.png][16]
![Differentiating potentially confusable characters][17]
Differentiating potentially confusable characters, [Paul D. Hunt][15] via Adobe Typekit Blog.
### [source_code_pro3.png][18]
![Metacharacters with special meaning in computer languages][19]
Metacharacters with special meaning in computer languages, [Paul D. Hunt][15] via Adobe Typekit Blog
### 5. Noto Mono: Enormous language coverage, created by a large team at Google
### [noto.png][20]
![Noto Mono example][21]
Noto Mono, Andrew Lekashman
The last font on our list is [Noto Mono][22], the monospaced version of the expansive Noto font family by Google. While not specifically designed for programming, Noto Mono is available in 209 languages (including emoji!) and is actively supported and updated. The project is enormous and is an extension of Google's stated mission to organize the world's information. If you want to learn more about it, check out this excellent [video about the font][23].
### Choosing the right font
Whichever typeface you select, you will most likely spend hours each day immersed within it, so make sure it resonates with you on an aesthetic and philosophical level. Choosing the right open source font is an important part of making sure that you have the best possible environment for productivity. Any of these fonts is a fantastic choice, and each option has a powerful feature set that lets it stand out from the rest.
--------------------------------------------------------------------------------
via: https://opensource.com/article/17/11/how-select-open-source-programming-font
作者:[Andrew Lekashman][a]
译者:[FSSlc](https://github.com/FSSlc)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://opensource.com
[1]:/https://opensource.comfile/377151
[2]:https://opensource.com/sites/default/files/u128651/firacode.png (FiraCode example)
[3]:https://opensource.com/file/377156
[4]:https://opensource.com/sites/default/files/u128651/firacode2.png (FiraCode compared to Fira Mono)
[5]:https://github.com/tonsky/FiraCode
[6]:https://opensource.com/file/377161
[7]:https://opensource.com/sites/default/files/u128651/inconsolata.png (Inconsolata example)
[8]:http://www.levien.com/type/myfonts/inconsolata.html
[9]:https://opensource.com/file/377146
[10]:https://opensource.com/sites/default/files/u128651/dejavu_sans_mono.png (DejaVu Sans Mono example)
[11]:https://dejavu-fonts.github.io/
[12]:https://opensource.com/file/377171
[13]:https://opensource.com/sites/default/files/u128651/source_code_pro.png (Source Code Pro example)
[14]:https://github.com/adobe-fonts/source-code-pro
[15]:https://blog.typekit.com/2012/09/24/source-code-pro/
[16]:https://opensource.com/file/377176
[17]:https://opensource.com/sites/default/files/u128651/source_code_pro2.png (Differentiating potentially confusable characters)
[18]:https://opensource.com/file/377181
[19]:https://opensource.com/sites/default/files/u128651/source_code_pro3.png (Metacharacters with special meaning in computer languages)
[20]:https://opensource.com/file/377166
[21]:https://opensource.com/sites/default/files/u128651/noto.png (Noto Mono example)
[22]:https://www.google.com/get/noto/#mono-mono
[23]:https://www.youtube.com/watch?v=AAzvk9HSi84

View File

@ -0,0 +1,87 @@
5 款适合程序员的开源字体
======
![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/documentation-type-keys-yearbook.png?itok=Q-ELM2rn)
什么是最好的编程字体呢?首先,你需要考虑到字体被设计出来的初衷可能并不相同。当选择一款用于休闲阅读的字体时,读者希望该字体的字母能够顺滑地衔接,提供一种轻松愉悦的体验。一款标准字体的每个字符,类似于拼图的一块,它需要被仔细的设计,从而与整个字体的其他部分融合在一起。
然而,在书写代码时,通常来说对字体的要求自然会更具功能性。这也是为什么当给定选择时,程序员更偏爱使用固定宽度的等宽字体。选择一款带有容易分辨的数字和标点的字体在美学上令人愉悦;但它是否拥有满足你需求的版权许可也是非常重要的。
使得一个字体更适合编程需要某些特定的需求。首先使得一款等宽字体看上去有条不紊需要一个非常详细的设定。这里,请考虑一会儿字母 `w` 和字母 `i` 之间的对比吧。当选择一款字体时,正如字母一样,在字母周围的空白也同样值得考虑。在物理书和新闻排版中,高效地使用空格也极为重要,相比于相对宽大的字母 `w`,字体将赋予相对瘦小的 `i` 更少的宽度。
然而在终端中,很幸运你将没有这些限制。每个字符享有相等的空白将非常有用。这么做的首要好处是你可以高效地通过简单的扫一下代码块,推测出你的代码有多长。第二个好处是能够很容易地对齐字符和标点,字符的高亮在视觉上更加明显。另外打印纸张上的等宽字体比均衡字体更加容易识别。
在本篇文章中,我们将探索 5 款卓越的开源字体,使用它们来编程和写代码都非常理想。
### 1. Firacode最佳整套编程字体
![FiraCode 示例][1]
FiraCode, Andrew Lekashman
在我们列表上的首款字体是 [FiraCode][3]一款真正符合甚至超越了其职责的编程字体。FiraCode 是 Fira 的扩展,而后者是由 Mozilla 委托设计的开源字体族。使得 FiraCode 如此特别的原因是它修改了在代码中常使用的一些符号的组合或连字,使得它看上去非常具有可读性。这款字体有几种不同的风格,特别是还包含 Retina 选项。你可以在它的 [GitHub][3] 主页中找到它被使用到多种编程语言中的例子。
![FiraCode compared to Fira Mono][2]
FiraCode 与 Fira Mono 的对比,[Nikita Prokopov][3],源自 GitHub
### 2. Inconsolata优雅且由卓越设计者创造
![Inconsolata 示例][4]
Inconsolata, Andrew Lekashman
[Inconsolata][5] 是最为漂亮的等宽字体之一。从 2006 年开始它便一直是一款开源和可免费获取的字体。它的创造者 Raph Levien 在设计 Inconsolata 时秉承的一个基本原则是:等宽字体并不应该那么糟糕。使得 Inconsolata 如此优秀的两个原因是:对于 `0``o` 这两个字符它们有很大的不同,另外它还特别地设计了标点符号。
### 3. DejaVu Sans Mono许多 Linux 发行版的标准配置,庞大的字形覆盖率
![DejaVu Sans Mono example][6]
DejaVu Sans Mono, Andrew Lekashman
受使用在 GNOME 中的带有版权和闭源的 Vera 字体,[DejaVu Sans Mono][7] 是一个非常受欢迎的编程字体,几乎在每个现代的 Linux 发行版中都带有它。在 Book 变种风格下 DejaVu 拥有惊人的 3310 个字形,相比于一般的字体,它们含有 100 个左右的字形。在工作中你将不会出现缺少某些字符的情况,它覆盖了 Unicode 的绝大部分,并且一直在活跃地增长着。
### 4. Source Code Pro优雅、可读性强由 Adobe 中一个小巧但天才的团队打造
![Source Code Pro example][8]
Source Code Pro, Andrew Lekashman
由 Paul Hunt 和 Teo Tuominen 设计,[Source Code Pro][9] 是[由 Adobe 创造的][10]它的首款开源字体
。Source Code Pro 值得注意的地方在于它非常具有可读性且对于容易混淆的字符和标点它有着非常好的区分度。Source Code Pro 也是一个字体族,有 7 中不同的风格: Extralight, Light, Regular, Medium, Semibold, Bold 和 Black每种风格都还有斜体变体。
![Differentiating potentially confusable characters][11]
潜在易混淆的字符之间的区别,[Paul D. Hunt][10] 源自 Adobe Typekit 博客。
![Metacharacters with special meaning in computer languages][12]
在计算机领域中有特别含义的特殊元字符, [Paul D. Hunt][10] 源自 Adobe Typekit 博客。
### 5. Noto Mono巨量的语言覆盖率由 Google 中的一个大团队打造
![Noto Mono example][13]
Noto Mono, Andrew Lekashman
在我们列表上的最后一款字体是 [Noto Mono][14] Google 打造的庞大 Note 字体族中的等宽版本。尽管它并不是专为编程所设计,但它在 209 种语言(包括 emoji 颜文字!)中都可以获取到,并且一直在维护和更新。该项目非常庞大,是 Google 宣言“组织全世界信息” 的一个扩展。假如你想更多地了解它,可以查看这个绝妙的[关于这些字体的视频][15]。
### 选择合适的字体
无论你选择那个字体,你都有可能在每天中花费数小时面对它,所以请确保它在审美和哲学层面上与你产生共鸣。选择正确的开源字体是确保你拥有最佳生产环境的一个重要部分。这些字体都是奇妙的可选项,每个都具有让它脱颖而出的功能强大的特性。
--------------------------------------------------------------------------------
via: https://opensource.com/article/17/11/how-select-open-source-programming-font
作者:[Andrew Lekashman][a]
译者:[FSSlc](https://github.com/FSSlc)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://opensource.com
[1]:https://opensource.com/sites/default/files/u128651/firacode.png (FiraCode example)
[2]:https://opensource.com/sites/default/files/u128651/firacode2.png (FiraCode compared to Fira Mono)
[3]:https://github.com/tonsky/FiraCode
[4]:https://opensource.com/sites/default/files/u128651/inconsolata.png (Inconsolata example)
[5]:http://www.levien.com/type/myfonts/inconsolata.html
[6]:https://opensource.com/sites/default/files/u128651/dejavu_sans_mono.png (DejaVu Sans Mono example)
[7]:https://dejavu-fonts.github.io/
[8]:https://opensource.com/sites/default/files/u128651/source_code_pro.png (Source Code Pro example)
[9]:https://github.com/adobe-fonts/source-code-pro
[10]:https://blog.typekit.com/2012/09/24/source-code-pro/
[11]:https://opensource.com/sites/default/files/u128651/source_code_pro2.png (Differentiating potentially confusable characters)
[12]:https://opensource.com/sites/default/files/u128651/source_code_pro3.png (Metacharacters with special meaning in computer languages)
[13]:https://opensource.com/sites/default/files/u128651/noto.png (Noto Mono example)
[14]:https://www.google.com/get/noto/#mono-mono
[15]:https://www.youtube.com/watch?v=AAzvk9HSi84