Custom Fonts in Latex


I recently spent two hours trying to figure out how to use a custom font in Latex. There were plenty of guides out there, but the problem is they all assume you want to install the font for regular use, complete with bold/italic variants, which means much more work, and more importantly, many more places to go wrong. Since there didn't seem to be an adequate resource out there for someone who just wanted to quickly get a font working for one use only, I thought I'd make one. It is based on this much more comprehensive guide by Otfried Cheong.

What you need

A TrueType font. Make a copy of it called custom.ttf, and put it in your working directory (the directory that contains your tex file).
The program ttf2tfm. It comes with Latex, so you probably don't need to do anything.
The files T1-WGL4.enc (download) and t1custom.fd (download). Put them in your working directory too.

What to do

Open a command line, go to your working directory, and enter:
ttf2tfm custom.ttf -p T1-WGL4.enc
In your tex file, write:
\newcommand\customfont[1]{{\usefont{T1}{custom}{m}{n} #1 }}
Every time you want blah blah in the custom font, write:
\customfont{blah blah}

That's it! It's so easy once you cut out all the steps you don't really need.