[OS X TeX] cmss vs. \sfdefault font question

Bruno Voisin bvoisin at mac.com
Tue Aug 8 05:08:00 EDT 2006

Le 8 août 06 à 03:37, Gary L. Gray a écrit :

>> As just pointed out by Herb Schultz as I'm writing this, it might  
>> also be a matter of T1 vs. OT1 vs. LY1 encodings, of the presence  
>> or not of CM-Super, of use or not of the lmodern package, etc.
> As I responded to Herb, I am loading:
> \usepackage[T1]{fontenc}
> \usepackage{lmodern}
> \usepackage{textcomp}
> I recalled that I had not installed CM-Super when I moved to the  
> new machine. I just installed it and it sort of fixed the problem.  
> Interestingly, the fonts are a little different between the version  
> in which I use:
> \renewcommand{\familydefault}{cmss}
> and when I use:
> \renewcommand{\familydefault}{\sfdefault}

This all makes sense.

With \usepackage[T1]{fontenc}, you reset the text font encoding to  
T1, implying that the font definition file t1cmss.fd is used instead  
of the default ot1cmss.fd, with the consequence that:

\EC at family{T1}{cmss}{m}{n}{ecss}

namely that the CM fonts (including cmss10) are replaced by the EC  
fonts (including ecss10). *But*, from within LaTeX, this remains the  
cmss family, only the encoding has changed from OT1 to T1. Thus, when  
defining the family default to be cmss, you are actually calling the  
ecss family of sans-serif fonts.

Hence, without the CM-Super fonts installed, the corresponding PK  
fonts are generated on-the-fly at each LaTeX run, from the  
corresponding MF sources. With the CM-Super fonts installed, you are  
using the PostScript form of the EC fonts in the usual way.

Now, with \usepackage{lmodern} you are setting:


meaning that \sfdefault refers actually to the lmss family in T1  
encoding, defined by t1lmss.fd to be the ec-lmss series of TFM metrics:

      {<-8.5> ec-lmss8
       <8.5-9.5> ec-lmss9      <9.5-11>  ec-lmss10
       <11-15.5> ec-lmss12     <15.5-> ec-lmss17

defined in turn by pdftex.map to be the lmss series of PFB fonts:

ec-lmss10 LMSans10-Regular "enclmec ReEncodeFont" <lm-ec.enc <lmss10.pfb
ec-lmss12 LMSans12-Regular "enclmec ReEncodeFont" <lm-ec.enc <lmss12.pfb
ec-lmss17 LMSans17-Regular "enclmec ReEncodeFont" <lm-ec.enc <lmss17.pfb
ec-lmss8 LMSans8-Regular "enclmec ReEncodeFont" <lm-ec.enc <lmss8.pfb
ec-lmss9 LMSans9-Regular "enclmec ReEncodeFont" <lm-ec.enc <lmss9.pfb

Such are the joys of NFSS2, aka LaTeX's 2e font selection scheme!

To summarize, with your LaTeX preamble, the cmss family refers  
actually to the ecss fonts (in PK form without the CM-Super fonts, in  
PS form with them) while the \sfdefault family refers actually to the  
lmss fonts (PS by design).

> I have posted them (including .log files) for you to look at:
> http://www.esm.psu.edu/faculty/gray/misc/cmss.zip
> http://www.esm.psu.edu/faculty/gray/misc/sfdefault.zip

Your log files are consistent with the above explanation. In cmss.log  
you have:

LaTeX Font Info:    Try loading font information for T1+cmss on input  
line 13.
File: t1cmss.fd 1999/05/25 v2.5h Standard LaTeX font definitions

then later:


On the other hand in sfdefault.log you have:

LaTeX Font Info:    Try loading font information for T1+lmss on input  
line 13.
File: t1lmss.fd 2005/08/29 v1.2 Font defs for Latin Modern

then later:


As safety measures I would recommend:

- To always stick to generic commands such as \sfdefault instead of  
the more specific cmss which do not always do as expected.

- To always install the CM-Super fonts when HD space and download  
time allow, to make sure no PK fonts are used in any circumstance.

Bruno------------------------- Info --------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
          & FAQ: http://latex.yauh.de/faq/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/

More information about the MacOSX-TeX mailing list