How to Choose a Good Programming Font for EditPad and Other Text Editors
EditPad Can Use Any Font
The good news is that EditPad can use any font available on your computer. It doesn't matter if the font is bitmapped or TrueType, monospaced or proportionally spaced. TrueType fonts like Verdana may look a bit better, but your favorite bitmap font like FixedSys will work just fine. Rectangular selections require a monospaced font like Courier New, but Arial will work great for everything else.
To install a font you've downloaded, right-click the .ttf file in Windows Explorer and choose Install in the context menu. To quickly install multiple fonts, drag-and-drop them onto the C:\Windows\Fonts folder in Windows Explorer. If EditPad is running, shut it down with File|Exit. Next time you start it the new fonts will be available.
Benefits of Monospaced Fonts
Most software developers prefer to use a monospaced font. Courier New is a classic, simply because it ships with all versions of Windows since 1995. As every programmer knows, the benefit of a monospaced font is that you can use spaces to indent logical blocks in source code. As spaces and all characters have the same width, all your columns will line up nicely. If you use a proportionally spaced font, you can still use spaces at the start of each line for indentation. But after the first non-space on a line, columns won't line up any more, because characters like "i" and "m" have rather different widths.
Requirements for Programming Fonts
There are countless proportionally spaced fonts available everywhere. These have a broad appeal because they look nice. Monospaced fonts put text in a fixed grid. Programmers love that, but most other people don't. So monospaced fonts are in limited supply. Great monospaced fonts are even rarer.
The biggest problem is that many monospaced fonts are not monospaced when you mix the plain and bold variants. Lucida Console and Andale Mono use wider characters for their bold variants. The three fonts below have plain and bold characters of equal width.
Syntax highlighting text editors often use bold to highlight keywords. If the bold variant is wider, the text editor has three choices. It can display the font accurately, resulting in columns that don't line up perfectly at the pixel level. It can force the font to be monospaced, usually causing the bold characters to be squished together. Alternatively, plain characters can be spaced more widely to match the bold characters. EditPad Pro supports all 3 options.
Many freely available fonts are bitmap fonts. These fonts come in fixed sizes, like 10 and 12 point. Other sizes are not available. If the font provides the size you want, that's great. But if it's too small or too large, you're out of luck. Printouts will look very pixelated, as the fonts are designed for screen resolution rather than printer resolution. Though you may find a great bitmapped font that meets all my criteria, I prefer to recommend only TrueType fonts. TrueType fonts look great at all sizes, and print at full resolution.
An issue with TrueType fonts is ClearType. ClearType smooths the edges of fonts to make them appear more nicely on LCD screens. ClearType can be turned on in Windows via Control Panel, Display applet, Appearance tab, Effects button, Smooth edges checkbox. On windows 7, click the Start button, type cttune, and press Enter. If you have an LCD screen (or two), I recommend you activate ClearType if you haven't already. While most fonts look much better with ClearType, the staple of monospaced fonts, Courier New, becomes almost unreadable. Courier New's letters are too thin to begin with. After smoothing, there's nothing left.
The fonts I recommend are designed to be used with ClearType. In fact, they'll look ugly and blocky without ClearType.
The ability to easily distinguish similar characters is important. In source code, a zero is not the same as an oh, and a one is not an ell. These characters are often very similar in fonts designed to produce appealing typography. They may even be identical in fonts simulating typewriters. The mechanical typewriter I inherited from my parents didn't have separate keys for zero and one. Typing an upper case O and a lower case l was the only way.
My programming fonts of choice all have a dot or slash inside the zero. The characters "1" and "l" are also easy to distinguish, at least within the same font.
Finally, the font needs a repertoire of characters suitable for your language. Not all monospaced fonts can display all the accented characters used in Eastern Europe, or the Greek and Cyrillic alphabets. Asian scripts are generally not supported, because most of them are hard to fit into a rectangular grid.
After supplying the same old fonts for many years, Microsoft has gone out of its way to include a whole bunch of new fonts with Windows Vista. One of them is the excellent monospaced font called Consolas.
Consolas is a perfectly monospaced TrueType font, designed for ClearType, with clearly distinguishable characters, and a wide repertoire of accented and Cyrillic characters. Characters are widely spaced, so you may need to select a larger font size than with other fonts.
Consolas ships with all versions of Windows Vista, Windows 7, and Windows 8. If you’re using Visual Studio 2005, you can download Consolas from Microsoft. If not, you still may be able to use the font, though your mileage may vary. I was able to install it on a Windows XP SP1 machine that doesn’t have any version of Visual Studio. This PC does have the Microsoft .NET Framework SDK which creates various “Microsoft Visual Studio” folders under “Program Files”. These may cause the Consolas installer to think I do have VS 2005. I got no error messages, and the font was instantly available in all applications.
Another way to get Consolas is to download and install the free PowerPoint Viewer 2007 from Microsoft. This works on any computer with Windows 2000 SP4 or Windows XP SP1 or later. In addition to the PowerPoint Viewer 2007 itself, the installer will install the following fonts: Calibri, Cambria, Candara, Consolas, Constantia and Corbel. Only the Consolas font is monospaced. All these fonts ship with Windows Vista, Windows 7, and Windows 8.
|Using the Consolas font in EditPad Pro|
Envy Code R
Envy Code R was created by Damian Guard, who makes it available as a free download on his blog. The download actually includes two sets of fonts, one of which is labeled "VS" for "Visual Studio". I didn't try the VS variant, but the unlabeled variant works great with EditPad.
Envy Code R is a perfectly monospaced TrueType font, designed for ClearType, with clearly distinguishable characters, and a wide repertoire of accented characters. Other alphabets are not supported. Characters are widely spaced, resulting in smaller characters for a given font size.
|Using the Envy Code R font in EditPad Pro|
Bitstream Vera Sans Mono
Other than being quite a mouthful, Bitstream Vera Sans Mono is one of the fonts in Bitstream's open source Vera font collection. It was originally designed for the Gnome project. You can get the font on the Gnome website, or right here.
Bitstream Vera Sans Mono is a perfectly monospaced TrueType font, designed for ClearType, with clearly distinguishable characters. Its repertoire of accented characters is limited. It does not support Cyrillic characters. Characters are tightly spaced, resulting in larger characters for a given font size. The characters are wider than the other two fonts, so fewer columns will fit on the screen. Vera Sans Mono is my personal favorite.
This font may be freely copied in its unmodified form. If you modify it, you have to rename your version to something completely different. A wide number of derivatives are available. Most aim to expand the font's repertoire to other alphabets. The DejaVu font family merges most of these. Note that the Vera font family includes more fonts than Vera Sans Mono. The Sans Mono font is the only monospaced one. Not all the additional scripts supported by the derived font families are in the Mono variant of the font.
|Using the Bitstream Vera Sans Mono font in EditPad Pro|
Text Layout in EditPad Pro 7
EditPad Pro 7 introduces a new "text layout" system for configuring how EditPad Pro displays your text. With the right set of options, you can make your text look just the way you like it, even with an imperfect font.
In the Options|Text Layout submenu you'll see 8 text layouts by default. The "left-to-right" layout does what EditPad Pro 6 and earlier did. It displays text from left to right and follows the font's spacing exactly as the font's designer intended. If you have syntax coloring mix bold and plain variants of fonts like Andale Mono or Lucida Console that aren't perfectly monospaced, columns may end up shifted by a few pixels here and there. The default font is Courier New or Consolas, depending on your version of Windows. The "proportionally spaced left-to-right" layout does the same as "left-to-right", except that the default font is Tahoma or Segoe UI.
The "monospaced left-to-right" layout forces text to be monospaced. The text will say monospaced even if you use a proportionally spaced font. This text layout allows you to use fonts like Andale Mono or Lucida Console and have all columns line up perfectly. By default the bold characters will be squished together a little bit to fit within the grid of plain characters.
The "monospaced ideographic width" layout is intended to be used when editing text in Chinese, Japanese, or Korean. It is the same as the "monospaced left-to-right" layout, but forces all ASCII characters to be the same width as ideographs. Unicode fonts have special "full-width" variants of the ASCII characters for this purpose. EditPad Pro 7 uses them when you select this text layout.
The other predefined text layouts are complex script layouts. Monospaced fonts don't work well with complex scripts.
For full control, select Options|Text Layout|Configure Text Layout in the menu. The configuration screen shown to the right appears. The "text layout and direction" group has the options relevant to this discussion. The "left-to-right" layout uses the "left-to-right only" option. The two monospaced layouts use the "monospaced left-to-right only" option. When you choose this option, the "ASCII characters with full ideographic width" checkbox determines whether ASCII characters are displayed normally or whether they're stretched to be as wide as ideographs.
The "line and character spacing" group has the options for fine-tuning the display. The default layouts have everything set to zero, making EditPad Pro use the font's default spacing. To fit more lines on a page, set the "line height" option to a negative number of pixels. To put more space between lines, set either "line height" or "extra space between lines" to a positive number of pixels. The difference is that when you select a block of line, increasing the space between lines will leave a gap between selected lines, while increasing the line height does not.
When using the "monospaced left-to-right only" text layout and direction with a font that isn't perfectly monospaced, you can increase or decrease the character width to get the look you want. By default EditPad Pro uses the width of the plain characters, which may cause bold characters to appear squished. If you add a pixel (or two for big font sizes) of character width, bold characters will look better. If you're forcing a proportionally spaced font to be monospaced, the default spacing may be too wide to your taste if some characters like "m" are significantly wider than others like "i". Set the character width to a negative number of pixels to space the characters more closely.
The best part of the text layout configuration in EditPad Pro 7 is that you can choose a different text layout for each file type. So you can use a strictly monospaced layout for file types with data in columns, while using the font's exact spacing for other file types. You can configure as many (or as few) text layouts as you like.
|Text Layout Configuration|
|File type editor settings where you can select a text layout. The edit button opens the Text Layout Configuration screen.|