1. Technology

Choosing the Best Font for your Delphi / Pascal Code


If you are like me, you look at your monitor screen for at least 8-12 hour per day. What's more, 90% of that time you are either writing Delphi / Pascal code or reading what you have written!

Having a readable, sharp, clean, crisp, nonospace font is a must if you do not want your eyes to suffer (and want more code per line)! A font you use must distinguish between similar characters, such as capital O letter and zero number (0) and the number 1, capital I (i), and lowercase l (L).

Fonts for Programmers

By default, the font Delphi uses in the Code Editor window is Courier New. Such monospace fonts (or fixed-pitch) contain characters that all have the same character width - text "alignes" more readily.

Courier New was *not* designed for coding. Delphi uses it as it is one of the few monospace fonts that ship with Windows.

An ideal font for programming must:

  • Be fixed-pitch (monospace). That is: non-proportional.
  • Have crisp, clean characters.
  • Designed primarily for use on the screen.
  • 1 (number), l (lowercase L), L (uppercase L) must not be confused.
  • 0 (number), o (lowercase O), O (uppercase O) must not be confused.
  • Have clear punctuation characters: parenthesis and brackets.
  • Be highly readable at small sizes.
  • Be Free :)

How to Change the Delphi IDE Font

Depending on your Delphi version, to change the default font used in the Code Editor window, you need to locate the "Options" dialog.

Before you can actually select a font you need to install in in Windows:

  • Decide and download the font you want to use.
  • Install the font into Windows by selecting the Fonts applet in the Control Panel.
  • Select the new font for Delphi IDE following the steps:
    1. In Delphi 2007, select "Tools - Options" from the main IDE menu.
    2. Navigate to "Editor Options - Display" then locate "Editor Font".
    3. From he drop down box, select your favorite Pascal writing font.

Fonts for Delphi / Pascal Code

Here's a selection of fonts you might want to try and decide which one fits best for you:
Courier New : Preview
Comes with Windows. Default Delphi IDE font.

Lucida Console : Preview
Comes with Windows.

Raize Font :: Preview
The Raize Font is a clean, crisp, fixed-pitched sans serif screen font that is much easier to read than the fixed pitched fonts that come with Windows. Ideally suited for programming, scripting, html writing, etc., the Raize Font can be used in any IDE or text editor.

Proggy Fonts :: Preview
The proggy fonts are a set of fixed-width screen fonts that are designed for code listings. They are distributed in Microsoft's .fon format, the truetype (ttf) format, as well as XWindows (Linux/BSD...) pcf format.

Inconsolata :: Preview
Inconsolata draws from many inspirations and sources. I was particularly struck by the beauty of Luc(as) de Groot's Consolas, which is his monospaced design for Microsoft's upcoming Vista release.

Bitstream Vera Fonts :: Preview
There are four monospace and sans faces (normal, oblique, bold, bold oblique) and two serif faces (normal and bold).

Andale Mono :: Preview
Rleased for free by Microsoft in the core web fonts pack.

Consolas :: Preview
Consolas is not free but it gets installed together with Office so many of us have it on the computer.

Leros :: Preview
Free. Created by Kostas Symeonidis. Designed for small screens / resolutions.

Preview selected Delphi Code Fonts

Build Your Own Font (And Let Us Know)

Raster Font Editor is an easy-to-use font editor for the creation of bitmap fonts. It supports several file formats and has a very simple yet fully customizable user interface.
The application can open font resource files (*.fnt) created by other tools. It can import DOS 8x16 fonts, fonts from BMP images and can convert TTF fonts to raster fonts.
You can save your raster fonts as Font Resource (*.fnt), Resource Script (*.rc), Text (*.txt) and Windows Bitmap (*.bmp). Saving as Text file is useful for debugging purposes and creating text representation of characters.

©2014 About.com. All rights reserved.