Best Unicode Fonts for Programing

, , …,

This page shows the best fonts for displaying math symbols and other common symbols. The focus is a font for programmers (or in terminal) that has the most Math Symbols ∑ ∞ ∫ π ∈ ℝ² and Dingbats ★ ♥ ✜ ☪ ☯ ☺ ☠. (without relying on the less-than-perfect font-substitution tech from the Operating System.)

There are lots fonts designed for programers, but as soon as you started to use some math symbols or Unicode symbols, they don't work well. Examples:

Best Variable-width Font for Unicode

Two best proportional font for Unicode are DejaVu Sans and Arial Unicode MS. Both are sans-serif.

DejaVu Sans

DejaVu fonts is a suite of fonts containing both fixed-width (monospaced) and variable-width fonts. It is bundled with Ubuntu Linux. It is a free. Download at Source dejavu-fonts.org.

Arial Unicode MS

On Microsoft Windows, you should try Arial Unicode MS. It comes with Microsoft Office, and is also in Mac OS X 10.5.

if you don't have it, you can download the trial version of Microsoft Office just to get this font (as of 2010), at Source office.microsoft.com. (the font is in TrueType (TTF) format)

emacs Arial Unicode MS font
Arial Unicode MS in emacs displaying Unicode chars.

Note that Arial Unicode MS has big gap between lines. So, you may not like it for programing. (but if you use emacs, you can adjust line-spacing. See “toggle-line-spacing” at How to Set Emacs's User Interface to Modern Conventions. )

For a comparison of these 2 fonts for reading, see: Unicode Font Comparison: Arial Unicode MS vs DejaVu Sans.

Best Fixed-Width Fonts for Unicode

DejaVu Sans Mono

The DejaVu Sans Mono from the DejaVu font suite is the best.

DejaVu has significantly more Unicode symbols than other popular fixed-width fonts such as {Courier New, Sans Mono, Miriam Fixed, Lucida Console, Lucida Sans Typewriter}.

GNU Unifont

GNU Unifont also contains most Unicode chars. Comes in most Linux distro. Its home page is at: Source unifoundry.com.

GNU Unifont is Bitmapped

GNU Unifont is a bitmapped font. (it's converted to scalable format (TrueType) in 2008 by Paul Hardy, but still bitmapped by design). This means, if you make the font size large, you'll see jagged edges.

emacs GNU Unifont
GNU Unifont when enlarged.

Note: There's also Fixedsys and Code2000 that contains extensive Unicode characters (more than DejaVu). However, their quality is very bad.

What About Mac?

Apple has very good font technology with many beautiful fonts. My experience is that it works out of the box for all your Unicode symbol needs. But if you are on a old version of Mac OS X and many Unicode chars on this page shows up as squares, you can install the fonts recommended on this page.

Math Fonts, STIX font: 𝔄 𝔅 ℭ

Most so-called Unicode font support Unicode char in the Basic Multilingual Plane (BMP). Some math symbols, such as gothic styled variant (𝔄 𝔅 …), or Double Struck variant (𝔸 𝔹 …), are not in the BMP and are not widely supported in even so-called Unicode fonts.

For font that support all math symbols, get STIX fonts. However, STIX is designed for typesetting math formulas, it's NOT USABLE for displaying normal text. For detail, see: Math Font, Unicode, Gothic Letters, Double Struck, ℂ ℍ ℕ ℙ ℚ ℝ 𝕊 ℤ ℭ ℑ ℜ ℨ ⅅ ⅆ ⅇ ⅈ ⅉ.

Unicode 6 and other Rare Unicode Symbols 😸 👍 👎

Unicode 6 added a few hundred emoticons, such as GRINNING CAT FACE WITH SMILING EYES 😸. These characters are not in any generic font, as of .

For these, you'll the Symbola font. See: Unicode 6 Emoticons.

Which Font Has All Unicode Chars?

No single font has ALL Unicode chars. At best, they contain all chars in the Basic Multilingual Plane (BMP). The BMP contains the most common 65.536 k chars. (Unicode has 16 other “planes”, but these are rarely used.)

I think it might be inefficient to have a font set to contain all Unicode chars. Both Windows and Mac OS X have Font substitution technology. When a char in the current font doesn't have a glyph, the system search for the glyph in other font set. So, this way, each font can be specially designed for a particular language or purpose, while you can still display many Unicode symbols in the same page.

StackOverflow answers: “How does a Unicode character get mapped to a glyph in a font?”: Source stackoverflow.com.

Thanks to Pete Forman who suggested the font DejaVu.

blog comments powered by Disqus