Windows

Make the Windows Font Viewer a more user-friendly experience

The Font Viewer is a good user tool to have when selecting fonts, but its interface is a bit clunky. Greg Shultz streamlines this utility with his Font Explorer HTA application and shows how it'll save you time.

To look at the fonts that you have installed on your Windows XP/2000 system, you can open the Fonts folder via the Control Panel and then double-click on a font to display a sample via the Windows Font Viewer. While this tool does an excellent job of displaying examples of the font at various point sizes and detailed information about the font, it comes up a bit short in the usability department. For example, viewing additional fonts is an extended procedure that involves closing the viewer window and then double-clicking on another font in the folder.

It would be nice to be able to scroll through a list of installed fonts, select one, and instantly see a sample. Of course, if you really wanted such a feature, you could probably download and install hundreds of shareware font viewers in your system. But doing so means adding yet another application to your system—one that more than likely contains a ton of features that you’ll never use. All you really want to do is browse the fonts you have installed.

I’ve developed an alternative: an HTML application (HTA) called the Font Explorer, which is designed to automate the existing Windows Font Viewer in Windows XP and Windows 2000 so that you can easily browse through all your fonts. You can download it here. There’s no need to install additional software that duplicates features that already exist in the operating system. I'll introduce you to my Font Explorer application and explain how it works. Then, I’ll show you how to use the Font Explorer to see the fonts that you have installed on your Windows XP/2000 system.

Caveats
The Font Explorer application is specifically designed to work in Windows XP and 2000. To use it in Windows 2000, you may need to add a single utility to your system. You can find that utility on your Windows 2000 CD and easily install it. If you’ve installed the Windows 2000 Support Tools, you’re all set to go. If you haven’t installed these additional tools and don’t really have the need to do so but want to run the Font Explorer application, you’ll need to copy the Kill.exe utility to your hard disk.

To do so, insert your Windows 2000 CD into the drive. As soon as the Autostart screen appears, select the Browse This CD option from the menu. When the folder window appears, open the Support\Tools folder and double-click the Support.cab file. Then, scroll through the list of files and locate the Kill.exe tool. Right-click on this file and select Extract from the shortcut menu. When you see the Browse For Folder dialog box, select the C:\Winnt or C\Windows folder and click OK. Once the Kill.exe file is copied to your Windows folder, you can close the folder window and the Autostart screen.

Installing the Font Explorer
Once you download the Font Explorer installation package, double-click the TFE Setup.exe file. The installation program will prompt you to choose a folder in which to install the application. If the folder doesn’t exist, the installation program will create it for you.

After you install the Font Explorer, you’ll see the following six files in your folder (I’ll discuss these files in more detail in a moment):
  • 1.cnt
  • 1a.cnt
  • 3.cnt
  • 4.cnt
  • Fonts.ico
  • FontExplorer.vbs

Tip
To make the Font Explorer easy to access, you can right-click on the FontExplorer.vbs file and select Send To | Desktop (Create Shortcut). You can then rename the shortcut and place it on the Start menu.

How the Font Explorer works
At this point, you’re probably looking over the list of files and wondering where the HTA file is. The fact is that it doesn’t really exist. It’s actually created on the fly each time you run the FontExplorer.vbs script. Let’s take a closer look at how this works.

To get an accurate listing of the fonts that you have installed in your system, FontExplorer.vbs delves into the registry and exports the contents of the Fonts key to a text file list. It then sorts the list alphabetically. As soon as the sort operation is complete, FontExplorer.vbs formats the list of fonts with the necessary code to produce a drop-down list and exports this code to a file called 2.cnt.

Once the list of fonts is ready, FontExplorer.vbs concatenates the 2.cnt file with the 1.cnt and 3.cnt files and creates FontExplorer.hta. (If you’re running Windows 2000, FontExplorer.vbs uses 1a.cnt.) As you can imagine, the 1.cnt file contains all the code that makes up the first part of the HTA—it ends right at the part where the code for the drop-down list is to begin. Of course, 3.cnt picks up right where the code for the drop-down list ends and contains all the code that makes up the third part of the HTA.

The end result of the concatenation is a fully functional HTA that displays all the fonts that you have installed in your system in an easy-to-use drop-down list. The last operation that the FontExplorer.vbs script performs is the launching of the FontExplorer.hta file, which brings up the Font Explorer window.

Once the Font Explorer window appears on the screen, you can click the drop-down list and see a list of all the fonts you have installed. As soon as you select a font from the list, the Font Explorer HTA will launch Windows’ Font Viewer and display that font in a maximized window. Font Explorer will then retake the focus and position its small window on top of the Font Viewer window in the upper right corner of the screen where it doesn’t block any significant information.

You can then select another font. When you do, Font Explorer will close the open Font Viewer window and then launch Font Viewer again with the newly selected font. The whole procedure will repeat itself with each font that you select from the list. When you’re finished, click the Close button and both the Font Explorer and Font Viewer windows will disappear.

To close the open Font Viewer window, Font Explorer uses the Taskkill.exe utility in Windows XP and the Kill.exe utility in Windows 2000. The 4.cnt file is a helper applet that is expanded during run time and used by FontExplorer.hta for controlling focus switching. The Fonts.ico file provides the Font Explorer HTA with the icon that it uses for the control menu and the taskbar.

Using Font Explorer
Now that you have a pretty good idea of the inner workings of Font Explorer, let’s take a look at the user interface. When you run FontExplorer.vbs, it performs the behind-the-scenes tasks instantaneously and then launches the Font Explorer HTA. You’ll see the Font Explorer window in the upper right corner of the screen, as shown in Figure A.

Figure A
The Font Explorer window is relatively small.


When you select a font from the drop-down list, the Font Viewer will launch and display the font in a maximized window. The Font Explorer window will then retake the focus, as shown in Figure B.

Figure B
Once the Font Viewer displays the font in a maximized window, the Font Explorer window retakes the focus, which makes it easy to successively view your fonts.


Keep in mind that if you select the Font Viewer window to scroll to the bottom of the example, the Font Explorer window will drop into the background. To bring the Font Explorer window back into focus, just click its icon on the taskbar or press [Alt][Tab]. When you’re finished viewing fonts, click the Close button and both the Font Explorer and Font Viewer windows will disappear.

Fonts galore
After using the Font Explorer to examine the various default fonts Windows 2000/XP have to offer, you might find yourself asking, “Is that all there is?” There are times when you need more than the default fonts to complete a project. For those of you in the market to add fonts to your inventory, Fonts.com offers a plethora of new and unique font and font packs for purchase. The site also provides information on font services to help you find or build the right font for a particular project.

About

Greg Shultz is a freelance Technical Writer. Previously, he has worked as Documentation Specialist in the software industry, a Technical Support Specialist in educational industry, and a Technical Journalist in the computer publishing industry.

0 comments