jackman.stanford.edu/blog
observations on politics, statistics, computing...

FFMeta

Saturday November 14, 2009

Filed under: computing, statistics, type — jackman @ 1:54 am

A recent e-mail correspondent writes:

I have a degree in applied statistics, and I’m really interested in the lectures notes you put on your website about Bayesian approaches and simulations. That’s something i need to discover and it looks really rich and interesting. I also use R on a very regular basis.

The purpose of this email is that I’m using LaTeX to write some documents, and i can’t find anything on how to install the FF Meta police, which is very clear and easy to read.
Have you anything about that by any chance?

First of all, I should take the Bayes notes down and point you in the direction of The Book (done!).

On FFMeta, I don’t quite get the references to “FF Meta police”. But here is how I did it (below the fold).

Screen Shot 2009-11-14 At 1.10.52 Am
Some graphic design friends in Sydney suggested Meta to me a while ago. I was looking for something that would distinguish my papers from the lovely but ubiquitous Computer Modern, that wasn’t Times + mtimes etc (which I’ve come to appreciate more and more, btw, perhaps since my book was set in Times etc), something that was “modern” but not so starkly sans-serif as to degrade readability.

I was originally playing with Gill Sans, which does have a Greek character set. But (a) graphic designer friends thought it a bit lame; (b) it is lovely for signage (“Signs on the wall identify this as Euston in a tasteful sans-serif that screams official credibility” wrote Neal Stephenson in Cryptonomicon), but not great in gobs and gobs of text. Students would also complain about its starkness in lecture slides: upper-case “I” is what, exactly (lower-case el, the numeral one, a vertical bar, or upper-case eye…).

So FFMeta seemed like a good solution: a hint of a serif, works well at different sizes. If I were to do it again, I’d think also about Whitney by Tobias Frere-Jones, or the Futura-ish look of Verlag. National looks like a lovely typeface as well, a Grotesk-ish sans that could work for both headers and text (then again, I have days when I think everything should be in Didot.

The downside was that Meta didn’t come with an extended set of “expert” glyphs or Greek characters (at least none that I could find). So I use Gill Sans Greek (actually Monotype GillSansDualGreekMT) for my Greek characters (except lower case \alpha and \chi, which I never liked the look of in Gill Sans Greek, substituting the Euler \alpha that ships with most tex distributions). I use as many symbols from Meta as I can, to keep the look and kerning standard (e.g., \neq, \leq, \infty, \pm \times) , but with default is to fall back on Computer Modern for symbols (e.g., \partial, \int, \forall). I never got this perfect, but its good enough.

When you get new typefaces, they often come as AFM files (Adobe Font Metrics) or TTF (TrueType). [Update: or OTF these days]. I got 24 AFM files when I purchased FFMeta. To use them in LaTeX you have to convert all of them (or the ones you want to use) to TFM (TeX font metrics), and specify an encoding (e.g., 8r, the TeX Base 1 Encoding); use the afm2tfm utility that comes with your tex distribution (part of the dvips side of things). The “-v” option will produce a VPL (virtual property list) so you can create “virtual fonts”. It has been a while since I’ve done this, and you can also use afm2pl utility to convert the AFM file to the a “property list” PL file, then pltotf to get the TFM files, and vpl2vpl and vptovf to get the VPL.

All that is complicated. fontinst attempts to automate the process. I’ve never used it, and I end up writing scripts like this. You probably want to look at Fontforge too.

LaTeX needs font definition files, which tell LaTeX which TFM file it should use when it encounters things like \emph{} and \bold{} or \textsc{} etc; here is mine, for my FFMeta setup. pdfLaTeX/dvips also need a map file, telling them how to map from TFMs to actual fonts to be included in the Postscript or PDF file (pfb files); here is my meta.map file (which won’t display properly in a browser window).

You need to keep your wits about you with naming schemes for fonts (TeX is unforgiving about this), where you put all these files when you are done, and finally (a) making TeX aware that you have new fonts to use, and (b) writing a .sty file that gives you access to the new fonts from inside your LaTeX document. It is inside that .sty file (in my case, meta.sty) that I have all the other hacks that define other characters and things. Put it all together and you get this (made from this).

Resources: this page is pretty good if you are in the Mac world. I also learned a lot from TeX Unbound by Alan Hoenig, but that book could be out of date by now, I don’t know.

Update: see comment #1. Forget all the scripting and carry-on above. Go use xelatex. Its only 5 years old (where have I been?!), and it certainly takes the pain out of switching fonts…

As per comment #1: use it with Will Roberston’s fontspec and unicode-math. Stop before 4am in the morning…your family will thank you.

Good Lord how did I miss this?

Comments (9)

9 Comments

  1. Wouldn’t para.s 6-10 be easier with xelatex, fontspec, and unicode-math?

    Comment by Chris Hanretty — Saturday November 14, 2009 @ 2:52 am

  2. Almost surely. My knowledge is old on this. I got FFMeta playing nice with GillSans Greek and CM etc around about 1999, and haven’t kept up with xelatex etc.

    Comment by jackman — Saturday November 14, 2009 @ 2:58 am

  3. Your correspondent may be French where the word for font/typeface is “police”.

    The good news is that there is a version of FF Meta with Greek support: FF Meta Pro (see page 2 of the Character Set).

    Comment by Stephen Coles — Saturday November 14, 2009 @ 9:50 am

  4. That assumes your software supports OpenType fonts. If not, there is a TTF flavored version (FF Meta Offc Pro that works with nearly all apps.

    Comment by Stephen Coles — Saturday November 14, 2009 @ 9:59 am

  5. Thanks Stephen. Nice sleek Greek characters there, although the \alpha isn’t “Greek” enough for me, like the Gill Sans Greek, and \chi looks too much like an x, which will cause some confusion.

    I was wondering about “police”… Thanks on that score too.

    Comment by jackman — Saturday November 14, 2009 @ 10:30 am

  6. I believe I asked the same question about one year ago (which also got published as blog post, though with less detail). I have been happily using XeTeX for three years now!

    Comment by Fr. — Saturday November 14, 2009 @ 5:53 pm

  7. Thats right Fr., you (and Chris Lawrence) mentioned xelatex here, on my blog. I’m sorry I didn’t pursue it then.

    Attempt at an excuse: with my book out of the way, this email asking about my FFMeta prompted me to write all this up, and look at xelatex when its existence was again pointed out to me.

    I’m having an interesting time converting my FFMeta AFM/PFBs to OT, fwiw. fontforge complains about errors in some of the glyphs.

    Comment by jackman — Saturday November 14, 2009 @ 7:18 pm

  8. I hate to be a downer, but it’s against the license to convert the font to another format. Easier to let the foundry do it for you anyway.

    Comment by Stephen Coles — Thursday November 19, 2009 @ 8:05 pm

  9. As nice and easy as xelatex is, there are still some problems with non-working/compatible packages.
    For example, microtype will not work.

    Comment by Daniel — Sunday December 6, 2009 @ 2:54 am

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.

Powered by WordPress

Bad Behavior has blocked 397 access attempts in the last 7 days.