145

I'm looking for a good programming font that lets me add comments and string literals in Unicode, usually Japanese and Chinese along with some Latin and Cyrillic languages.

So far the situation seems to be "complete, monospace, free, pick 2" and Google is failing me with this (maybe because there are no good ones?).

The best I found is Arial Unicode but it's not monospace, which is a big nuisance for me and the editors I use. Not to mention Python indentation when I'm coding Python.


(Links, edits are welcome)

nachik
  • 754
  • 3
  • 9
  • 11
  • Based on https://en.wikipedia.org/wiki/Samples_of_monospaced_typefaces I would nominate Droid Sans Mono. But the page doesn't say anything about code point coverage; I know Droid's is reasonable, but many of the others on the page are fairly limited. – tripleee Sep 22 '14 at 07:39
  • The "WenQuanYi Micro Hei Mono" font (on my Kubuntu machine, can't recall if I installed it separately) does mono-spacing and Japanese characters. – egeland Jun 08 '15 at 09:10

9 Answers9

72

Unicode is big. Really big. You just won't believe how vastly hugely mind-bogglingly big it is. I mean, you might think it's a long way down the codepage to ü, but that's just peanuts to Unicode.

I really doubt there's any font in the world (monospaced or not) that has "complete" Unicode. The best you can do is find a few monospaced fonts that, together, cover the space you're interested in, and make sure your editor is set up to use them.

Ken
  • 561
  • 2
  • 5
  • 8
  • 34
    "You just won't believe how vastly hugely mind-bogglingly big it is..." - been reading the Guide, have we ? :)) (I've never seen the word "mind-bogglingly" except in that book) :)) – Rook Feb 25 '09 at 16:05
  • 3
    I believe it's big and I don't mind it being big :) I'd settle for something as complete as Arial but monospace. – nachik Feb 25 '09 at 16:07
  • 2
    +1, you won't find a font that covers *all* of Unicode including the weird non-BMP stuff. The best you'll find are Japanese fonts, which tend to contain things like Cyrillic that are also in Shift-JIS. See eg. Microsoft's default Japanese UI font ‘Gothic’. – bobince Feb 25 '09 at 20:57
  • However, this can be a real compromise in practice as Latin letters made to fit the kanji square can be much too large and ugly. Do you *really* need monospace even for non-Latin characters? You'll be able to get a much prettier display by compromising on this. – bobince Feb 25 '09 at 20:58
  • 2
    I reckon monospace is hard for Arabic and some others, but my main needs are Latin subsets, Cyrillic, CJK (Chinese-Japanese-Korean). Arial Unicode covers all this then some. I'd like something like that but monospace. Gothic, Mincho are not Chinese-complete. Simsun, Mingliu etc are not jp-complete. – nachik Feb 25 '09 at 23:17
  • 16
    There can't be any font that covers all of Unicode, since Unicode has onepointsomething possible code points (400k assigned or so) and OpenType only supports 65k glyphs per font :) – Joey Mar 04 '09 at 02:40
  • "Unicode is big. Really big." Arial is big. Have you taken a look at it? It's ugly as all get-out, but it's all (nearly) there! – lmat - Reinstate Monica Jun 13 '12 at 14:47
  • 4
    Monospace is *not* hard for Arabic. Computers have been using monospaced Arabic for decades just fine. All that needs to be done is not combining multiple characters into single glyphs. The result is not expected to match handwritten caligraphy but works great for programming. The writing systems that don't work well are those where combining multiple characters into single glyphs is mandatory, or where characters are rendered out-of-order. That means most Indic and many Southeast Asian languages and scripts. – hippietrail May 30 '13 at 01:28
  • epic reference, bro. Anyway, yeah, unifont is a good choice usually. – Wyatt Ward Apr 08 '15 at 15:05
49

The best I've found is DejaVu Sans Mono which is a Unicode expansion of Bitstream's Vera Sans Mono.

I'm not sure there are any 'complete' fonts, so I think you'll have to deal with a patchwork of fonts.

Douglas Leeder
  • 52,368
  • 9
  • 94
  • 137
  • 6
    Unfortunately, DejaVu Sans Mono 2.33 (as of 2012-09-28) doesn't include CJK ideograms, e.g. it doesn't include even basic Chinese characters. My research concluded with the only monospaced font supporting Chinese character being "GNU Unifont". – Abdull Sep 28 '12 at 20:20
  • 1
    I tried DejaVu Sans Mono Book in Sublime Text2. It doesn't appear like it's a fixed-width font(I thought that's what Mono stands for). – Piti Ongmongkolkul Jan 17 '13 at 08:54
  • It's especially good for coding, because it distinguishes `l` from `1` and `I`, and `0` from `O` – endolith Mar 26 '13 at 19:51
  • For people using Vim (at least GUI versions) you can set one font for single-cell characters (Latin, Greek, Cyrillic, Georgian, etc) and another for double-cell characters (Chinese, Japanese, Korean). I often use DejaVu Sans Mono in combination with one of the CJK fonts that comes with Windows for this purpose. – hippietrail May 30 '13 at 01:24
33

GNU Unifont is a monospaced, bitmapped font with complete coverage of the Basic Multilingual Plane as defined in Unicode 5.1. It is also avaiable in True Type format.

user287424
  • 1,219
  • 12
  • 22
  • 7
    Complete and free, but not quite fixed-width. As Roman Czyborra says, "If we wanted the character cell to be big enough to also draw any ideograph with more than 4 vertical strokes in it, we would end up with cells ... way oversized for Latin letters... Instead, I would like to ... distinguish halfwidth (ASCII) characters occupying one cell each from fullwidth (CJK) characters occupying exactly two consecutive cells. This makes the font somehow proportional (more complex characters get more space) and fixed-pitch (the cell grid is respected) at the same time." http://czyborra.com/unifont/ –  Jul 01 '12 at 21:54
  • Unfortunately, I had no luck with this one in PuTTY. It would display my current text but as soon as I hit Enter, everything would be blank again. – tripleee Nov 05 '13 at 16:35
  • I found the GNU Unifont suggestion to be the best solution for my purposes. I use Notepad++ and selected it as the global font. I have the best compromise of both the special characters, graphics, and symbols I use (even glyphs such as a snowflake) and the standard ASCII characters I use in web development. – Charles Cavanaugh Dec 09 '13 at 15:52
  • I've been looking for a font that aligns unicode box drawing characters on mac... Thank you very much! – GabrielOshiro Feb 16 '15 at 20:46
  • my favorite option. I use it for everything in my terminals. – Wyatt Ward Apr 08 '15 at 15:07
  • @sampablokuper As of today, this is no longer the case - nowadays all cells in Unifont have 16x16 px dimensions. – Markus von Broady May 14 '15 at 17:36
15

How about Consolas? Should be lying around on most windows boxes by now.

If not it can be downloaded here:

http://www.microsoft.com/down...lang=en

It does look ugly without ClearType enabled though.

Iain M Norman
  • 2,075
  • 15
  • 30
  • Another vote on this one. It doesn't look all that bad without CT. And there is also a unix-pandan, Inconsolas or something like it (I never remember font names). – Rook Feb 25 '09 at 16:06
  • 12
    Consolas covers only Latin, Greek and Cyrillic. It's a beautiful font but it doesn't cut it for me. Forces me to use multiple fonts, which is no-go for some editors. – nachik Feb 25 '09 at 16:22
  • 1
    Inconsolata: http://www.levien.com/type/myfonts/inconsolata.html – Constantin Apr 08 '09 at 10:59
5

I'm trying to answer this question for myself, for use in Eclipse editor.

MS ゴシック (MS Gothic) is what I'm currently trying, and that seems to be pretty good for the Japanese characters I'm dealing with. Included in Windows since 2000.

Craig McQueen
  • 41,871
  • 30
  • 130
  • 181
  • 1
    It's ugly as hell for Latin and especially Cyrillic (it comes out as double width), but +1. – tripleee Nov 05 '13 at 15:06
  • 2
    Also, I had to open up the Windows 7 fonts and click "Show" on this font before I could select it in the font menu; it is installed but hidden by default in my install (Windows 7 Pro US English). I also had to restart PuTTY in order for it to update its font list. – tripleee Nov 05 '13 at 16:34
5

Before Consolas, I always used Andale Mono as my programmer font. There's a free download available.

GvS
  • 52,015
  • 16
  • 101
  • 139
3

One could be constructed from the Unicode Consortium's published CodeCharts.pdf by font extraction via FontForge. However:

  1. Legal issues would be a serious consideration.
  2. The extracted fonts do not align their characters to unicode code points, but rather place them at various points sometimes in order, sometimes haphazardly. Remapping them is a chore (but orders of magnitude easier than creating a font from scratch).
  3. Character combining, etc., logic is complex (I'd personally prefer a dumb uncombined font, with one visual position per codepoint, and display them just like on the codepages).
wchargin
  • 15,589
  • 12
  • 71
  • 110
Ant Manelope
  • 531
  • 1
  • 6
  • 15
2

GNU Unifont does indeed have the complete Unicode BMP. unfortunately the UTF8 map has about 16 times as many characters, including some CJK extensions. My advice is to download Unifont and add the other characters you need by hand or by copying them from another font.

-2

Actually I find monospaced fonts to be a nuisance when I have to read them so I use Tahoma or even Georgia for my source code. I have a very verbose coding style (an instance of type AstractModemConnector is named abstractModemConnector) so my source code looks almost like English and is perfectly readable with a proportional font.

Bombe
  • 81,643
  • 20
  • 123
  • 127
  • 2
    I take it you don't ever use Python? ;) Even when coding other stuff, I just like having my stuff aligned. I use vim mostly, or gvim. I also use Komodo and Eclipse every now and then. – nachik Feb 25 '09 at 16:09
  • 5
    The language doesn’t matter, indenting with four space characters takes up a certain amount of space, eight characters use double that amount. Unless of course you are implying that Python is very cryptic and having a proportional font is of no use because you can’t read Python fluently anyway. :) – Bombe Feb 25 '09 at 17:06
  • 4
    Well I find having to read Chinese a nuisance but that's what the question asked for. :-) – Ken Feb 25 '09 at 17:53
  • 2
    I use proportional fonts for Python coding all the time, don't see any problem with it. You'd need spaces to line up if you were doing that style of line-breaking where you try to align with the above opening bracket (or whatever), but that has a whole bunch of other problems too, so best avoided... – bobince Feb 25 '09 at 21:04