If you want to display more source code text in a limited window, you can:

  1. Use a proportional font.
  2. And/or condense horizontally your favourite font.

Let’s compare three fonts displaying the same source code text:

FontForge (GPL)

FontForge is an open-source visual font editor.

Here is the procedure to reduce the width of a font:

  • Run FontForge.
  • In the favourite directories list, choose C:\Windows\fonts (if you are on Windows).
  • Select the font to be used as a base.
    Example: verdana.ttf.
  • OK.
  • Menu Edit / Select / Select all (Ctrl+A).
  • Menu Element / Transformations / Transform (Ctrl+\).
    • Center of selection (can be named Origin too) : Glyph’s origin.
    • Move : Scale.
      • H : 90 %.
      • V : 100 %.
    • Check Transform all layers (can be named Transform background too).
    • Uncheck Round to int.
    • OK.
  • Wait for the generation process.
    • Some warnings may appear. Just ignore them.
  • Menu Element / Font info (Ctrl+Shift+F).
  • Section Postscript names (can be just named Names).
    • Modify the three names.
      Please note some of them do not accept spaces.
    • OK.
  • Accept the generation of a new identifier.
  • Menu File / Generate fonts (Ctrl+Shift+G).
    • Be sure the selected type is TrueType.
    • Uncheck Validate before saving.
    • Select a directory, not fonts because you need write access rights.
    • Generate (can be named Save too).
  • Close FontForge.
    • You probably do not need to save the project file untitled.sfd.
      It is not necessary anyway.

Open your favourite file manager, then:

  • Open the directory where you saved your font.
  • Open the font.
  • On Windows, the font manager displays your font and gives you the opportunity to install it so it is available to all software (admin rights may be needed).

Of course, I can’t distribute the fonts I modified since I don’t have rights on them.
But now you can tune fonts by yourself.
Enjoy !

Proportional fonts for programming

By the way, you may have noticed I personally use a proportional font for programming, in that instance a condensed version of Verdana.
The reasons are:

  • Fixed-width fonts usually display less text than proportional fonts.
    Of course, when a ‘i’ is as wide as a ‘X’, sure we waste some surface.
  • Fixed-width fonts are less readable.
    Mainly because they are inconsistent with usual fonts such as the GUI, word processors and Web fonts, and in fact the real world fonts.
    Naturally, our brain needs time and efforts in order to adapt to new fonts, new character sizes, new colors, etc.
  • Verdana has something most other proportional fonts doesn’t have: it differentiates upper ‘I‘ and lower ‘l‘.
    Very important when many names begin with a I, such as Interface.
  • I simply consider fixed-size fonts as prehistoric antiquities.
    They should not have survived to typewriters.

N.B. The color theme visible on the screen shots is available on Notepad++ and on Visual Studio.