[texhax] Bypassing errors when loading fonts

Sam Brown s_d_j_brown at hotmail.com
Tue Jun 4 00:40:42 CEST 2013

Dear all texhaxers

I am wanting to write a document that displays all the fonts available on my system. To do this I've enlisted a batch script that returns all .tfm files in my texmf tree, which is then processed with R to create a LaTeX file with every font available. Unfortunately, a couple of errors get in the way of successful compilation. The first is that a number .tfm files produce the error: "Font xxxx not loadable: Bad metric (TFM) file". The second is that some files that pass this first test, throw a second error when compiled by themselves: "mktexpk: don't know how to create bitmap font for xxxx"

What I would like is some sort of condition that tests to see if the font can be loaded and created. If it can, the test text is written in the font. If it can't, a message saying so is printed to the document. Any advice towards this end would be much appreciated. 

A minimal working example follows. The code should run properly as is. Uncomment the first line (fcsstt20) to get the first error, and the second (gbklisl25) to get the second.

Thank you very much!

Samuel Brown
Postgraduate Student
Bio-Protection Research Centre
PO Box 84
Lincoln University
Lincoln 7647
New Zealand
sam.brown at lincoln.ac.nz

% Mimimal working example


\def\defaultfont{\font\supertinyfont = cmss10 at 10pt \relax \supertinyfont} 

    \def\tempfont{\font\supertinyfont = #1 at 10pt \relax \supertinyfont} 
    The quick brown jumps over the lazy dog




% \fontTest{fcsstt20}
% \fontTest{gbklisl25}


More information about the texhax mailing list