[Tex/LaTex] Which common LaTeX Fonts come prepackaged with specific settings for Microtype

fontskerningmicrotypepdftexprotrusion

For anyone interested in achieving the very best microtypography: Some fonts apparently come with microtype specific settings, other fonts don't, in which case microtype applies "Default" settings that might be less than perfect for all those other fonts.

There are a good many fonts available with LaTeX, so it might be difficult to figure out all the ones that have specific microtype settings, but we can note some of the most popular ones. Currently, I'm using the newcent font families and wonder if microtype is using it's default microtypography settings, which I never tweak.

Which of the common fonts have specific configuration settings for use with the microtype package?

(Please add to this list of popular fonts as more font microtype configurations become available for them, or make a note besides the ones that don't support custom configurations, or have shown poor performance)

  1. I believe all the major TeX distributions come with this PSNFSS collection of PostScript fonts. Do these have prepackaged settings?

    • package — / Roman Family / Sans Serif / Typewriter /
    • default — / CM Roman / CM Sans Serif / CM Typewriter /
    • mathpazo — / Palatino / none / none /
    • mathptmx — / Times / none / none /
    • helvet — / none / Helvetica / none /
    • avant — / none / Avant Garde / none
    • chancery — / Zaph Chancery / none / none /
    • bookman — / Bookman / Avant Garde / Courier /
    • newcent — / New Century Schoolbook / Avant Garde / Courier /
    • charter — / Charter / none / none /
  2. Also I use LyX to organize my novel, and these are the other Roman fonts that are available from it's drop down menu:

    • Latin Modern
    • Utopia** (fourier)
    • Bitstream Charter
    • Bera Serif
    • Concrete Roman
  3. Here are some more popular fonts. (Garamond is the most popular for novels today):

    • URW Garamond
    • EB Garamond
    • Garamond Expert
    • Linux Libertine
    • Lucida Bright

Since my project is a novel, I'd like to chose a font from among those that have microtype specific settings.

Best Answer

I don't think it is reasonable to expect a full list to be created and maintained here. I think it is better to explain how to figure out whether fonts have this support so that users can determine the current answer for a specific font for themselves. If nothing else, this will enable people to check whether an answer here is still correct.

Thérèse is right that $(kpsewhich -var TEXMFDIST)/tex/latex/microtype/ contains configuration files for microtype. But this provides only a limited amount of information because:

  • some configuration files are located elsewhere;
  • the presence of a configuration file does not establish support in general because whether a particular font has such support depends on further factors (the engine, the encoding etc.);
  • the lack of a configuration file does not demonstrate the absence of such support because one font may be declared as an alias and, if the fonts are sufficiently similar, this may amount to a custom configuration.

I illustrate these points by examples.

Configuration files elsewhere

  • EB Garamond: $(kpsewhich -var TEXMFDIST)/tex/latex/ebgaramond/mt-EBGaramond.cfg.
  • Junicode: $(kpsewhich -var TEXMFDIST)/tex/latex/junicode/mt-Junicode.cfg

Presence of file does not establish support

A file may be present without supporting a font in a particular encoding with a particular engine.

  • Some features of microtype just are not supported by some engines regardless of configuration files. All features are supported by pdfTeX, many are now supported by LuaTeX, some are supported by XeTeX and none are supported by TeX.
  • mt-LatinModernRoman.cfg does not support Latin Modern if you compile with pdfTeX because this file concerns encodings only used by XeTeX and LuaTeX. So the presence of a file for a font does not establish that customised settings will be used in your document, even if your engine supports all microtype features and you use that font. [Latin Modern is supported - see below - but this file proves nothing if you are using pdfTeX.]

Absence of file does not establish lack of support

  • One file may support more than one font.

mt-cmr.cfg includes this code:

\SetProtrusion
   [ name     = lmr-T1,
     load     = cmr-T1   ]
   { encoding = {T1,LY1},
     family   = lmr      }
   {
     \textquotedblleft  = {300,400},  \textquotedblright = {300,400}
   }

This means that Latin Modern Roman will largely use the protrusion settings for Computer Modern Roman when loaded in encodings T1 or LY1, with a couple of additions or adjustments.

But the crucial work is done in microtype.cfg. There a good number of aliases are defined, including:

\ifMT@fontspec
\DeclareMicrotypeAlias{lmr} {Latin Modern Roman}
\else
\DeclareMicrotypeAlias{lmr} {cmr}  % lmodern
\fi

This means that if fontspec is in use, the settings from mt-LatinModernRoman.cfg will be used. Otherwise, the settings for Computer Modern Roman will be used.

However, this is not necessarily true merely because you are using Latin Modern Roman. You must be using it as lmr. If you are using the lmodern package, all will be well. But if you are using cfr-lm, then you are using Latin Modern Roman but you are not using lmr:

\renewcommand{\rmdefault}{clm\cfrlm@rmpt\cfrlm@rmol}

Which family this is depends on the options used, but whatever options are active, the result will not be lmr. It will be clm.... So the alias configured in microtype.cfg will have no effect.

To figure out whether microtype will use custom settings, we need to look to another section of cfr-lm.sty (with some comments removed):

\newcommand{\cfr@ffs}{% alias to cmr
  clm,clm2,clm2j,clmj,% roman
  clms,clm2js,clm2s,clmjs,% sans
  clmqs,clm2jqs,clm2qs,clmjqs%
  }
\gdef\cfrlm@MicroType@Aliases{%
  \@for \xx:=\cfr@ffs \do {%
          \DeclareMicrotypeAlias{\xx}{cmr}}%
  }
\def\cfrlm@MT@Hook{\cfrlm@MicroType@Aliases}
\@ifpackageloaded{microtype}{%
  \cfrlm@MT@Hook}{%
  \@ifundefined{Microtype@Hook}{%
        \let\Microtype@Hook\cfrlm@MT@Hook}{%
        \g@addto@macro\Microtype@Hook{\cfrlm@MT@Hook}}}

This sets up aliases for the various families to Computer Modern Roman if, and only if, microtype is loaded by the user.

[To be honest, I'm not certain these are right now. Every time I look into this, it seems different. However, my code is apparently based on discussion on this site, so it must be good ;), mustn't it?]

The Acid Test

If all of that seems really complicated, that's because it is. Fortunately, there is a very simple way to determine whether a font has customised microtype settings or not. Simply use the font in a document, compile with microtype and examine the log file.

\documentclass{article}
\usepackage{cfr-lm}
\usepackage{microtype,kantlipsum}

\begin{document}

\kant[1]

\end{document}

Compiling this test with pdfLaTeX, the following lines appear in the log file:

(/usr/local/texlive/2014/texmf-dist/tex/latex/microtype/mt-cmr.cfg
File: mt-cmr.cfg 2013/05/19 v2.2 microtype config. file: Computer Modern Roman

This shows that the alias has resulted in the relevant settings being loaded.

Now replace cfr-lm by kpfonts and examine the log:

Package microtype Info: Loading generic settings for font family
(microtype)             `jkp' (encoding: OT1).
(microtype)             For optimal results, create family-specific settings.
(microtype)             For optimal results, create family-specific settings.
(microtype)             See the microtype manual for details.

This tells us that no custom settings for jkp with encoding OT1 were found and that microtype is therefore relying on generic settings in this case.

Final note

Of course, whether font-specific settings are an improvement depends entirely on the quality of those settings. If I've messed up the aliases in cfr-lm or the person who created the settings for Computer Modern Roman lacked an eye for detail, you might be better off with the generics!

EDIT

Here are the results replacing cfr-lm in the above with newcent and compiling with pdfLaTeX:

Package microtype Info: Loading generic settings for font family
(microtype)             `pnc' (encoding: OT1).
(microtype)             For optimal results, create family-specific settings.
(microtype)             See the microtype manual for details.

So microtype uses generic settings in this case.