您的位置:首页 > 职场人生

程序员的最爱:编写代码的十大字体

2015-05-13 21:40 363 查看
编码时选择写代码的字体很重要,于是看到这两篇文章。这是同一篇文章,我先看到了译文,又搜索到了原文。原文:Top 10 Programming Fonts(http://hivelogic.com/articles/top-10-programming-fonts),译文:让代码更美(http://www.y3y.org/2010/01/20/10-programming-fonts.html),译文不完整,我把二者糅合结合起来。在windows XP 上,我发现第二名的Consolas很不错,名字也好记,啃手拉丝—蜘蛛?:)
Top 10 Programming Fonts Sunday, 17 May 2009 (You’re reading Hivelogic, a website about leading a more simple, mindful life. This site was established in 2000 by Dan Benjamin, a writer, developer, broadcaster, and usability geek. Subscribe to the RSS feed for updates.) I’m a typeface geek, and when it comes to selecting a font I’ll stare at all day, I tend to be pretty picky. Recently, when I discovered that a friend was using a sub par typeface (too horrible to name here) for his Terminal and coding windows, my jaw dropped, my heart sank a little, and I knew it was due time for me to compose this article. What follows is a round-up of the top 10 readily-available monospace fonts. Many of these fonts are bundled along with modern operating systems, but most are free for download on the web. A few, notably Consolas, are part of commercial software. A note about anti-aliasing In the past, we’ve had to decide between tiny monospace fonts or jagged edges. But today, modern operating systems do a great job of anti-aliasing, making monospace fonts look great at any size. It’s not 1990 anymore. Give your tired eyes a break and bump up that font size. If you have any doubt that anti-aliased fonts are apropos for code, note that even the venerable BBEdit — which for years has shipped with un-aliased Monaco 9 set as the default — has made the jump. The app now ships with a specially licensed version of the Consolas font from Ascender, bumped up in size, and with anti-aliasing on by default. Panic includes a special anti-aliased font (Panic Sans, which is actually just a version of Deja Vu Sans Mono) with its popular Coda application. Unless otherwise noted, I’ve used a larger size font, 15-point in fact, for the examples here to illustrate their legibility at larger sizes and with anti-aliasing turned on. 日复一日的编写代码,有没有感到审美疲劳?也许些许的改变就能让我们感到生活更美好。
换一种编程字体吧!体验一种新的代码感觉。 下面我眼中的十大编程字体: 10. Courier All systems ship with a version of Courier (sometimes Courier New), and unfortunately, many have it set as the default font for terminal and editor windows. It does the job, but it’s a bit dull and boring, lacking style and class. I don’t recommend this font if you have any other choice — and fortunately, you do. If you use this font, please bump the size and turn on anti-aliasing. 基本上所有的系统都自带了此种字体,有时候它又以Courier New的名字出现。不幸的是很多终端和编辑器都默认使用此种字体,虽然这不会影响使用,但这会影响心情,它太枯燥了。以前看到这样一句评论:久不见牡丹会以仙人掌为美。这句评论形Courier字体非常合适。所以如果你还有其他选择的话,请勿使用此字体。更不幸的事情是最后你还是会继续使用它,那3秒只能强烈建议你调整一下字体大小并消除锯齿。

Figure 1 Courier New 9. Andale Mono A bit better than the Courier family, Andale Mono is still relegated to the “default font” category as it ships with some systems, and you wouldn’t want to download or use it if it wasn’t already there. The character-spacing is a bit too clumsy and the letters are a bit too wide for my tastes. 稍微比Courier好一点的字体,有些时候它也被用作默认字体。3秒给它的定义是:一个软件不自带就不会有人去专门下载使用的一种字体。

Figure 2 Andale Mono 8. Monaco Monaco is the default monospace font on the Mac and has been since its inclusion in System 6. It’s a solid, workhorse font that really shines at smaller font sizes with anti-aliasing turned off. I loved this typeface back when my eyes could tolerate staring at a 9-point font for hours, but those days are behind me. This font looks great at 9 or 10-points (Figure 4), and doesn’t look too shabby anti-aliased at higher sizes (Figure 3). As far as I know, you can only get Monaco as a part of Mac OS, but there are alternatives, so keep reading. 使用苹果Mac的人们对它不陌生,它是Mac的默认字体,3秒的经验是:使用它时,把字体设置为9号或者10号时会更好,这样看起来就相对不寒酸了。


Figure 3 Monaco

Figure 4 Monaco 9-point, without anti-aliasing 7. Profont Profont is a Monaco-like bitmap font available for Mac, Windows, and Linux (there’s also a modified version for Mac OS X called ProFontX by a different author). They’re best at smaller sizes, and make a great alternative to Monaco if you’re on a non-Mac platform and want really tiny fonts and the eyestrain that goes along with them. Profont (and ProFontX) is intended for use at 9-points with anti-aliasing turned off. Profont是一种类Monaco的位图字体,你能够在Mac, Windows和Linux上面使用,Mac平台的ProFontX就是它的修改版,当然两个字体并非出自同一作者之手。如果使用它,你把字体调小一点为好。而且如果你是非Mac平台,它是Monaco的最佳替代者。如果你喜欢微小字体或者喜欢眼疲劳,你可以考虑一下它。

Figure 5 Profont 9-point, without anti-aliasing 6. Monofur Monofur is a unique monospace font that looks great anti-aliased at all sizes. It’s a fun font with a distinct look that is vaguely reminiscent of Sun’s OPEN LOOK window manager, which ran Solaris (aka SunOS) systems back in the late 80’s. If you’re looking for something a bit different, try this font, but make sure you have anti-aliasing turned on, even at small sizes. Monofur是一种独特的等宽字体,各种大小看起来都非常不错,前提是你已经设置为消除锯齿。这种字体的外观比较独特,看着它容易让你想起上世纪八十年代Sun的Solaris(SunOS)上的OPENLOOK窗口管理器。如果你喜欢新鲜的东西,你可以试一下这种字体,再次提示一下:消除锯齿。

Figure 6 Monofur 5. Proggy Proggy is a clean monospace font that seems to be favored by Windows users, although it works fine on a Mac. It’s a clean font intended to be used only at smaller points, and without anti-aliasing. Proggy是一种很干净的等宽字体,貌似受到很多Windows用户的青睐,在Mac上它同样工作正常。使用它一般把字体调小点,不要消除锯齿。

Figure 7 Proggy Clean at 15-point (yes, 15-point), without anti-aliasing 4. Droid Sans Mono The Droid font family (available for download here) is a nice font family designed for use on the small screens of mobile handsets, like Android, and licensed under the Apache license. Droid Sans Mono makes for a great programming font. It’s got a bit of flair, and stands out among the other monospace fonts I’ve listed, and its only real flaw is the lack of a slashed zero. Droid 字体家族 适合手机等小屏幕的移动平台,比如Android。它在Apache许可证下授权。伟大的编程字体,在我列出的等宽字体中它是最突出的一个。

Figure 8 Droid Sans Mono 3. Deja Vu Sans Mono The Deja Vu family of fonts are one of my favorite free font families, based on the excellent Vera Font family. The Deja Vu fonts have been updated with a wider range of characters while maintaining a similar look and feel to that of Vera. This was my go-to font family for many years. It looks great at any size with anti-aliasing turned on. Panic ships a font with it’s Coda application called “Panic Sans” which is based on this font. Gruber says via email that when he compared Panic Sans against Vera, he noted that “Panic had noticeably crisper punctuation chars” and that it seemed like they had improved the hinting on some characters as well. Deja Vu 是我最喜欢的免费字体家族之一,基于Vera字体家族。Deja Vu已经能够支持更多的字符了,并保持了Vera的外观和感觉。适于任何大小,只要你消除锯齿。

Figure 9 Deja Vu Sans Mono 2. Consolas Consolas suddenly appeared on my Mac after I installed Microsoft Office, along with a handful of other new fonts from Microsoft. This font was designed by Luc(as) de Groot for Microsoft’s ClearType font family (there’s a nice write-up with samples of each of the new Microsoft fonts here). Consolas is a commercial font, but is bundled with many Microsoft products, so there’s a good chance you might already have it on your system. You’ll absolutely want to have anti-aliasing turned on if you’re using Consolas, because it’ll look terrible without it. Too bad it’s not free … if it was, it would be #1 on this list. Consolas是商业字体,它是Luc(as) de Groot为微软ClearType字体家族设计的,与微软很多产品绑定在一起,所以幸运的是可能你的系统上已经有它的存在了。如果你在不消除锯齿的情况下使用它,那还不如使用Courier吧!

Figure 10 Consolas 1. Inconsolata Inconsolata is my favorite monospaced font, and it’s free. Shortly after discovering it, it quickly supplanted Deja Vu Sans Mono as my go-to programming font. I use it everywhere, from Terminal windows to code editors. It has a certain sublime style that’s unique without being over the top, and it looks fantastic at both large and small sizes. I use this font when I show code samples in a presentation, and it’s the font we use in Terminal and TextMate windows when filming PeepCode screencasts. Inconsolata is designed to be used with anti-aliasing enabled, but it’s surprisingly legible even at very small sizes. A big thanks to Raph Levien for creating this font, and for making it free. Inconsolata是我最喜欢的等宽字体,而且是免费的。在发现它之后,3秒迅速改变了Deja Vu Sans Mono作为我默认编程字体的情况。从终端窗口到代码编辑器,我让它无处不在。它的风格非常独特。设计它的时候就已经把锯齿消除了,就算是非常小的时候也很清晰—真正的情况是它适合于任何大小。感谢Raph Levien创造了Inconsolata,并让它免费。

Figure 11 Inconsolata Thoughts? Did I miss your favorite coding typeface? Think the list is out of order? Let me know. If there’s a typeface you think should be in this list, please let me know in the comments section below. If it meets my ridiculous standards, I’ll review it and include it in a follow-up article. Filed in Development, Software. 这些字体中大部分是免费的,可以自由下载。有些是是商业软件的一部分,比如Consolas。你感觉怎么样?如果感觉相见恨晚,不妨去尝试一下。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: