# Choosing font for bold small caps (or any other particular family+series+shape combination)

What is the best way (most proper and general solution) to get rid of the warning

LaTeX Font Warning: Some font shapes were not available, defaults substituted.


by explicitly setting which font should be used for particular family+series+shape combination in edited document?

Bold small-caps are not widely available font-wise. E.g. they are available in CM-Super (which the default font for T1 encoding), but not in overall better Latin Modern.

Let's say I use Latin Modern as the default font (\usepackage{lmodern}). What should be done to make LaTeX fallback to CM-Super in case of bold small caps? (And only in the case of bold small caps, medium small caps should remain typed using Latin Modern.)

-
As always a minimal working example (MWE) as reference would be very much appreciated. People could then use it to implement, test and compare their solutions. –  Martin Scharrer Jul 4 '11 at 0:40
@Martin: I've avoided giving MWE on purpose. I prefer to make this a more general question, but I still gave a specific example w/ bold small caps and lmodern+cm-super, because sometimes people just prefer to think about concrete case. –  przemoc Jul 4 '11 at 0:48

AFAIK you just need to declare that font shape using \DeclareFontShape. You can just declare the font shape to use the font shape of the standard font. This should lead to the same result as before just without the warning.

Using lmodern with T1 font encoding you get the following warning with \scshape\bfseries:
LaTeX Font Warning: Font shape T1/lmr/bx/sc' undefined
(Font)              using T1/lmr/bx/n' instead on input line 19.

LaTeX Font Warning: Some font shapes were not available, defaults substituted.


So you need to declare the font shape T1/lmr/bx/sc. As Ulrike pointed out you can substitute another font using the following code:

\documentclass{article}
\usepackage[T1]{fontenc}

\DeclareFontShape{T1}{lmr}{bx}{sc} { <-> ssub * cmr/bx/sc }{}

\begin{document}

{\normalfont normal font}
{\scshape small caps}
{\ttfamily tt family}
{\bfseries bold font}
{\scshape\bfseries bold small caps}% works and uses cmr font instead of lmr

\end{document}

-
Effort appreciated. It is good as it works for my exemplary case, but at the same time I cannot say I like it, because it requires checking and copying some stuff from .fd file, which I believe should be avoidable, as we're ultimately reusing family+series+shape already defined out there. –  przemoc Jul 4 '11 at 1:14
Mmm, Adobe Acrobat Reader crashes with the above MWE when I try to display Properties->Fonts! pdffonts actually displays the fonts nicely, so does evince. –  Martin Scharrer Jul 4 '11 at 1:15
Works in okular too, where I see shiny new SFXC1200. :-) –  przemoc Jul 4 '11 at 1:22
@przemoc: There's nothing else to do in this case; the font you desire is not available in the Latin Modern family. If their developers don't add themselves such a substitution, it's impossible for LaTeX to define it by itself: no default substitution can be allowed to change the family. –  egreg Jul 4 '11 at 8:10
You can use the sub (or ssub) function to declare the substituation: \usepackage{lmodern} \normalfont %to load T1lmr.fd \DeclareFontShape{T1}{lmr}{bx}{sc} { <-> ssub * cmr/bx/sc }{} –  Ulrike Fischer Jul 4 '11 at 9:06