[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:
\renewcommand{\sfdefault}{lmss}
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:
\DeclareFontShape{T1}{lmss}{m}{n}
{<-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.
(/usr/local/teTeX/share/texmf.local/tex/latex/base/t1cmss.fd
File: t1cmss.fd 1999/05/25 v2.5h Standard LaTeX font definitions
)
then later:
{/usr/local/teTeX/share/texmf.local/fonts/enc/dvips/cm-super/c
m-super-ts1.enc}</usr/local/teTeX/share/texmf.local/fonts/type1/
public/cm-super
/sfss1200.pfb>{/usr/local/teTeX/share/texmf.local/fonts/enc/dvips/cm-
super/cm-s
uper-t1.enc}</usr/local/teTeX/share/texmf.local/fonts/type1/public/cm-
super/sfs
s1200.pfb></usr/local/teTeX/share/texmf.local/fonts/type1/public/cm-
super/sfsx1
200.pfb></usr/local/teTeX/share/texmf.local/fonts/type1/public/cm-
super/sfss144
0.pfb></usr/local/teTeX/share/texmf.local/fonts/type1/public/cm-super/
sfsx2074.
pfb>
On the other hand in sfdefault.log you have:
LaTeX Font Info: Try loading font information for T1+lmss on input
line 13.
(/usr/local/teTeX/share/texmf.tetex/tex/latex/lm/t1lmss.fd
File: t1lmss.fd 2005/08/29 v1.2 Font defs for Latin Modern
)
then later:
{/usr/local/teTeX/share/texmf.tetex/fonts/enc/dvips/lm/lm
-ts1.enc}</usr/local/teTeX/share/texmf.tetex/fonts/type1/public/lm/
lmss12.pfb>{
/usr/local/teTeX/share/texmf.tetex/fonts/enc/dvips/lm/lm-ec.enc}</usr/
local/teT
eX/share/texmf.tetex/fonts/type1/public/lm/lmss12.pfb></usr/local/
teTeX/share/t
exmf.tetex/fonts/type1/public/lm/lmssbx10.pfb>
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