超越等宽字体:寻找完美的编码字体

What makes a font suitable for writing code? Back in 2021, when I started working on Martian Mono—the Evil Martians font for programming—I naively believed it was just a matter of making all characters the same width, and maybe including some code ligatures. But over the years, I’ve discovered that a well-made developer font requires much more than simply being monospaced.

什么样的字体适合编写代码?在2021年,当我开始制作Martian Mono(Evil Martians用于编程的字体)时,我天真地认为只需要让所有字符具有相同的宽度,可能还包括一些代码连字。但多年来,我发现一个制作精良的开发人员字体需要比单纯的等宽字体更多的东西。

The magic of a good coding font all comes down to the design of a few specific characters. Since the function of those characters differs when used in code versus regular text, it makes sense to design them accordingly. In this article, I’ll outline these characters in the hopes that this post will be helpful reference for both developers choosing a new font to work with and for type designers in the process of crafting a font dedicated to development purposes. Go down through the list and consider whether of not the characters in your font meet these winning criteria.

一个好的编码字体的魔力完全取决于几个特定字符的设计。由于这些字符在代码和普通文本中的使用方式不同,因此设计它们具有相应的意义。在本文中,我将概述这些字符,希望这篇文章能成为开发人员选择新字体和专门用于开发目的的字体设计师的参考。请逐个查看列表,并考虑您的字体中的字符是否符合这些优胜标准。

In regular text, hyphens are used to join words, like this: “five-year-old.” But in the world of code, hyphens are primarily used as a minus signs. This has some historical roots: because the hyphen has always been an available character on keyboards, programming language developers designed compilers and interpreters to treat hyphens in source code as minus signs.

在常规文本中,连字符用于连接单词,例如:“five-year-old.”但在代码世界中,连字符主要用作减号。这有一些历史根源:因为连字符一直是键盘上可用的字符,编程语言开发人员设计编译器和解释器以将源代码中的连字符视为减号。

Machines don’t care, but for the sake of human perception, it would certainly be helpful if hyphens visually matched the subtraction symbol, given its similar meaning and function; this is also why it’s practical for the hyphen to be designed as a minus sign in a coding font.

机器不在乎,但为了人类的感知,如果连字符在视觉上与减号符号匹配,这将非常有帮助,因为它们具有类似的含义和功能;这也是为什...

开通本站会员,查看完整译文。

Home - Wiki
Copyright © 2011-2024 iteam. Current version is 2.139.0. UTC+08:00, 2024-12-22 22:13
浙ICP备14020137号-1 $Map of visitor$