TrueType fonts in LaTeX

Today, I got utterly frustrated in LaTeX. I wanted to use some new font, Verdana (standard Microsoft font). Using it in LaTeX just isn’t that easy!

Overview

I’ve found most of my inspiration at:
Using TrueType fonts with TeX (LaTeX) and pdfTeX (pdfLaTeX)

This guide takes you step by step with the command line, to turn your .ttf (TrueType font) files to .tfm (TeX Font Metrics), .afm (Adobe Font Metrics) and .vf (Vitual Font) files.
The guide builds on MikTeX, but it also works on my TeXLive!, for only one change, which will be explained later.

The Script

I’ve written a little script createVerdanaFont.bat which creates the Verdana font, given the files:

  • verdana.ttf
  • verdanai.ttf
  • verdanab.ttf
  • verdanaz.ttf
  • T1-WGL4.enc

If you don’t have these files, go and look for them…
The file Verdana.txt has more information about the output files.

I must admit that the naming conventions are still not completely right, but a lot better than the source article…

As a last note I must say that I didn’t find any way to scale the font in pdfTeX, so it was only available in standard size, otherwise Adboe Reader told me that a required font was not found, and it was substituted by Helvetica.
After a while, I didn’t even know how Verdana looked like, having seen so much of Helvetica! I restarted the whole process, resulting in only being able to reproduce the correct (and resizable) fonts in latex itself, outputting to dvi, then dvips’ing it and converting with Adboe to pdf, although very automated thanks to TeXNiC Center.

TeXLive! vs MikTeX

I never got the hang of MikTeX on Windows, and still got an older release (2003) of TeXLive!, but it works.

The following step should not be taken under TexLive!:

Edit the file c:\texmf\miktex\config\miktex.ini: find the line which starts with “TrueType Font Dirs=” and add windows fonts directory:

TrueType Font Dirs=.;%R\fonts\truetype//;c:\windows\fonts

Instead, just copy the TrueType font files (*.ttf) to
$TEXMF/fonts/truetype/$FONT_DISTRIBUTOR/$FONT_NAME

Other changes only involve other paths, but searching the TeXMF tree will result in you finding the file in discussion.

Conclusion

Not that you’re so much wiser now, but if you are considering the installation of a new font, I still strongly discourage you to do so on Windows. I have been told that on Linux it should be a bit easier, having the Type1 fonts, but you would have to see for yourself.
There are enough standard fonts available, which are (at least almost) just as nice as the other fonts!

Downloads

Verdana to LaTeX batch file download

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s