Using ftxvalidator

Posted by scottstoel on March 15, 2009 at 7:23 pm.

A few posts ago we talked about Apple Font Tools, ftxinstalled fonts in particular. Apple Font Tools is a suite of command line utilities that can help you with many issues concerning fonts on your Mac. One of the helpful tools included in this suite is ftxvalidator. This tool can be very useful if you have fonts that don’t validate in Font Book or in third-party applications such as FontAgent Pro. ftxvalidator can give you more information on why the font is bad or corrupt, and maybe give you a clue as to what to do to fix the font. So if an application tells you a font is corrupt, and you don’t quite agree, or want to know why, ftxvalidator can offer you the second opinion you want.

Download and Install Apple Font Tools

If you already downloaded Apple Font Tools for the tutorial on ftxinstalled fonts there is no need to download again, and you can skip the install instructions below and proceed to the next section. If this is your first time working with Apple Font Tools, download Apple Font Tools Release 3.1.0 at the link here.

Download the file, unzip it, then double-click on the Apple Font Tool Suite 3.1.0.dmg to open it. Then, double-click on the Apple Font Tool Suite 3.1.0.mpkg and click through the installer.

Since Apple Font Tools are command line based (there are a couple of gui utilities installed as well, but we will visit those later); there is no application you can double-click on to access these tools. You will need to run these tools from Terminal.

Apple Font Tools - ftxvalidator

The utility we are going to look at in this article is ftxvalidator. This powerful tool inspects font files for errors. This tool can be used to examine individual font tables within a file, but here we are going to examine entire fonts which will return information about all the tables ftxvalidator tests for.

Running ftxvalidator

First we need to launch Terminal. This can be found in the Applications/Utilities Folder.

ftxfinderscreensnapz0011

Then at the prompt type “ftxvalidator”, a space, then drag a font file to the terminal window. When you drag a file onto the terminal, it will insert the path to the file. Then hit return.

For example, I use FontAgent Pro to manage fonts. One of the features of FontAgent Pro is that it checks fonts for corruption. When it finds a corrupt font, it sequesters the font file to a folder called Corrupt files in the FontAgent Pro Fonts folder.

Below, I have a screen shot of a file, in this case VT102Font, that has been tucked away in the Corrupt files folder.

newcorruptview

To check this font with ftxvalidator all I need to do is copy the text below and paste it into Terminal.

ftxvalidator

Then drag the font file onto the Terminal window. (You will need to make sure that there is a space after ftxvalidator)

ftxdragtoterminal

Then hit return. The report is in the screenshot below:

ftxvalidatorrepot

From the report we can see that this font had two styles, VT100 Roman and VT100 Bold. Both styles have errors in the cmap table, which suggests a structural problem with the font file. There is also an error in both styles concerning a missing a font table. In this case the glyf table, which is required.

From this report we can see why the font was deemed corrupt by FontAgent Pro. Many times the report can give us information that can suggest a plan of action, but with this font there is little we can do. If fact, this font cannot even be opened with a font editor like FontLab Studio or Fontographer.

Checking More than One Font for Errors

The proceedure above is good for checking one font, but if you want to check a folder of fonts, ftxvalidator can do this too.

First, get a folder of fonts. the type cd into Terminal, and drag the folder into Terminal. This changes the working directory in Terminal to the directory containing the fonts.

Then type (or copy and paste) the text below to the prompt in Terminal.

ftxvalidator *

Note: The asterisk (*) is a wildcard. This means every font in a folder will be checked for errors. If a font does not have any errors ftxvalidator will return the name of the font with no additional information.

If you don’t want to scroll through a Terminal window to search the results of this command, you can save a text file of the report by using the command below:

ftxvalidator * > ~/Desktop/validatorreport.txt

This writes a file named validatorreport.txt to the desktop. This report can be opened in a text editor and you can easily scan it to see if any of the fonts in the folder have errors.

In this article we have taken a look at the validation abilities of ftxvalidator. Stay tuned for future posts that show additional capabilities of Apple Font Tools Suite.