1. Home
  2. Computing & Technology
  3. Delphi Programming

Choosing the Best Font for your Delphi / Pascal Code

By Zarko Gajic, About.com

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.

Preview selected Delphi Code Fonts

Explore Delphi Programming

More from About.com

  1. Home
  2. Computing & Technology
  3. Delphi Programming
  4. Coding Delphi Applications
  5. Coding standards
  6. Choosing the Best Font for your Delphi / Pascal Code

©2008 About.com, a part of The New York Times Company.

All rights reserved.