[Show/Hide Left Column]

Selecting a custom font for ZTreeWin

ZTreeWin is a console application and requires a Monospace font(external link).
ZTreeWin v1 uses the OEM character set? ZTreeWin v2 uses Unicode.
The Help file "3.12 Shortcut Setup" describes how to set font type and size.

Unfortunately there are few choices of font.
Win98 et al only allow a choice between Bitmap & TrueType in various font sizes.
W2K & XP allow Raster or Lucida Console, despite the fact that at least one other "Courier New" is already installed.

Microsoft explains how to add fonts(external link) by changing the following registry key (needs a reboot):
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Console\TrueTypeFont

Add a String Value
Name=00The name needs to be incremented with "0" for each additional font
Data="Font Name"

Examples:-
"0"="Lucida Console"
"00"="Courier New"
"000"="Andale Mono"
"0000"="Consolas"
"00000"="DejaVu Sans Mono"



Another trick is to use Font linking to allow characters that are missing from one font to be found in another, it can be used with the method above.
There are some issues with this method
o. Performance can be affected when using the linked fonts.
o. Glyphs in some fonts are of different sizes i.e. the ones for south east Asia languages, this can cause alignment issues.
see the following
Microsoft Globalization page(external link)
Tip Font linking(external link)
Double-width Asian glyphs in Western consoles(external link)
Font resource site(external link)

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontLink\SystemLink
Add a Multi-String Value
Name=Lucida ConsoleAssuming that you are going to use Lucida Console as the ZTree font
Data=
Cour.TTF, Courier New
LucidaTypewriterRegular.TTF,Lucida Sans Typewriter
MSGothic.TTC,MS Gothic
SimSun.TTC,NSimSun
Gulim.TTC,GulimChe
Consola.TTF,Consolas


If you want to try others the Microsoft article includes Necessary Criteria for Fonts to Be Available

  • The font must be a fixed-pitch font.
  • The font cannot be an italic font.
  • The font cannot have a negative A or C space.
  • If it is a TrueType font, it must be FF_MODERN.
  • If it is not a TrueType font, it must be OEM_CHARSET.
Unfortunately this is not much help, unless you are writing a program. Program to enumerate Fixed Width Fonts(external link)
ZTreeWin also has some additional requirements; The Box Characters ? ? ? ? etc are required, and characters 00-1F (04 ? for tagged files, 18 ?, 19 ?, 1A ? and 12 (up down arrow)).

Character Map/Advanced View (Character Set DOS: United States - or whatever) shows characters supported (unfortunately not 00-1F)
Find this in Start/Programs/Accessories/System Tools/Character Map or %SystemRoot%\System32\charmap.exe
This will show that Consolas is no use, as it is missing the Box Characters.

Unfortunately Windows does not show which are fixed-pitch fonts, this can only be done by trial and error or Program to enumerate Fixed Width Fonts(external link)
An easy way to do this is to open FontTest.txt in Notepad, and try different Fonts. (This is a unicode file, and only displays CP 437.)
Font Size

When you select a TrueType font in a console application, the font size (height) is shown in pixels. (Raster fonts show width*height.)

In a Windows application the font size (height) is shown in points (~ 1/72inch).

Windows calculates the height in pixels using the following formula:-
FontHeight = PointSize * LogicalPixelsPerInch / 72

LogicalPixelsPerInch is usually 96, so a 9 point font is 12 pixels high.

Where are the fonts?

Direct links Andale Mono(external link) Bitstream Vera Sans Mono(external link) DejaVu Sans Mono(external link) (if these don't work try:-)
Reviews, Information & Download links on Monospace/Fixed Width Programmer's Fonts(external link)
There are a number of Raster fonts (and information) on DOSFon(external link)
Consolas (and other ClearType fonts) are included in Microsoft Office 2007 Compatibility Pack(external link)
Consolas in Consolas Font Pack for Microsoft Visual Studio 2005 or 2008(external link)
Do not forget all the old Microsoft packages e.g. Plus! which also included fonts.
Gallery of Unicode Fonts(external link) contains a large number of fonts, organised by Language. Monospace fonts are not identified, but you may find some which may be useful e.g. Courier MonoThai

Contributors to this page: admin2 , ian , BenKent and admin .
Page last modified on Wednesday 03 of August, 2011 02:41:04 EDT by admin2.