27

For anyone interested in achieving the very best microtypography: Some fonts apparently come with microtype specific settings while other fonts don't. In that 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 /
  1. 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
  1. 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.

6
  • 4
    Look in texlive/2014/texmf-dist/tex/latex/microtype/. EB Garamond has a configuration file too.
    – Thérèse
    Commented Apr 6, 2015 at 17:21
  • Great! I adjusted the list above adding EB Garamond.
    – user12711
    Commented Apr 6, 2015 at 17:55
  • @Thérèse That's a good start. But it is a bit more complex. It isn't just a matter of which font, but also which engine and which encoding you're using. To complicate things further, lack of a specific file is not necessarily an issue if an appropriate alias is configured and the font aliased is sufficiently similar. Some of this information is not in that directory. Moreover, font packages may have configuration files which are located somewhere else. But this comment will get too long...;)
    – cfr
    Commented Apr 7, 2015 at 0:37
  • The microtype documentation lists all fonts, including aliases, for which the package provides dedicated settings (table 3 on page 21). But that's only the ones shipped with microtype itself, there are other packages that contain their own settings (see @cfr's answer).
    – Robert
    Commented Apr 7, 2015 at 3:06
  • In order to fit the Q&A-format here better, I’d suggest separating your list off into an answer (a community wiki answer, if you’d like other users to edit and complement the list).
    – doncherry
    Commented Apr 12, 2015 at 11:46

2 Answers 2

19

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.

15
  • 2
    Nice answer! You could add the MinionPro package, which also provides microtype settings.
    – Robert
    Commented Apr 7, 2015 at 3:08
  • 1
    @user12711 I wouldn't go by court requirements. There are jurisdictions where everything has to be submitted in Courier! Anyway, what do you want to know about that excerpt from the log file? First it tells you what it is trying to do: load font settings for fonts in encoding T1 and family pnc. This is due to some instruction on input line 56. Then it notes that it has found t1pnc.fd and where, and confirms that this file provides settings for encoding T1 and family pnc.
    – cfr
    Commented Apr 7, 2015 at 23:35
  • 1
    @user12711 Presumably you also loaded fontenc with option T1. So it loads the font in that encoding for you. I didn't change to T1, so it used OT1 when I tested. The only difference in output, as far as microtype's warning is concerned, is the OT1 in the message I posted is T1 if I load fontenc with option T1. That's because microtype looks for settings by font family and font encoding. So if OT1 is active, it looks for them for OT1/pnc. If T1 is active, it looks for settings for T1/pnc.
    – cfr
    Commented Apr 7, 2015 at 23:38
  • 2
    @user12711 T1 and OT1 are font encodings. pnc is the name of the font family in what is called the Karl Berry scheme. (Such names are doled out, when necessary, by Karl Berry who is responsible for many things TeX. If you want such a name, you email him and ask for it.) Anyway, the first letter is the foundry (p means Adobe). The next 2 letters are the family name (nc presumably for New Century). I think that's it. Did I miss anything?
    – cfr
    Commented Apr 7, 2015 at 23:40
  • 1
    @user12711 I don't think so. You could always test. EB Garamond and the TeX-Gyre fonts are part of TeX Live. I don't know how your distro packages them. I have always used vanilla TL, which includes the lot. You might have to install additional packages if you've not got a full installation of TeX. (Vanilla TL is easier IMHO, even though you have to learn to install it.)
    – cfr
    Commented Apr 8, 2015 at 3:16
0

Related: What if you wish to use a particular font, but it does not have existing protrusion settings? Is there a strategy? Yes, if you are willing to do the work. This is best for OpenType fonts; results with other types are unknown (to me).

You can load the font file into a font editor, such as FontForge. Take note of its grid units (almost always 1000 per em, for OpenType *.otf fonts). Copy an important letter such as lowercase i to to Guide layer. This will be a reference for position.

Then look at each glyph that is of interest to you (depends on your language). How much do you need to move it horizontally, so that its left side looks good when compared to the Guide i ? That is a useful value for left protrusion.

Right protrusion is trickier, since it involves comparing the right side of the reference letter, to the right side of other letters. A single Guide letter will not work. But, you can create a copy font with everything flipped horizontally; then its left-side values will be the right-side values for the original font.

When writing the microtype protrusion values, be sure to use units of em.

Caution: Use your judgement. Some folks recommend protrusions that were used long ago (pre-automobile) but are not generally used nowadays. For example, hanging a hyphen outside the normal textblock.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .