# Why does vector graphics font not exist for a certain size?

In my understanding, vector graphics font can be shrunk or expanded without limitation. In other words, its size spans in continuous real numbers. But I got surprised after getting the following warnings:

\documentclass{article}
\usepackage[a4paper,margin=2cm]{geometry}
\pagestyle{empty}
\usepackage[OT1]{fontenc}
\makeatletter
\DeclareMathSizes{\f@size}{\f@size}{0.6\f@size}{0.3\f@size}
\makeatother

\newcommand\foo[1]
{{#1%
Such as $E=mc^2$ or,
$\int_{a_1}^{b^2}f(x)\,\textrm{d}x=F(b^2)-F(a_1)$
}}

\parindent=0pt
\begin{document}
\begin{description}
\item[Huge]
\foo{\Huge}
\item[huge]
\foo{\huge}
\item[LARGE]
\foo{\LARGE}
\item[Large]
\foo{\Large}
\item[large]
\foo{\large}
\item[normalfont]
\foo{\normalfont}
\item[small]
\foo{\small}
\item[footnotesize]
\foo{\footnotesize}
\item[scriptsize]
\foo{\scriptsize}
\item[tiny]
\foo{\tiny}
\end{description}
\end{document}


Why does vector graphics font not exist for a certain size?

-
Well design font need to be drawn for the specific sizes it will be used at (which is so called optical scaling), CM font one of the few fonts that are available on several optical sizes. Compare CM5 and CM10 rendered at the same size. –  Khaled Hosny Jul 23 '11 at 19:11

Latex 2e uses the New Font Selection Scheme (NFSS) to associate font families with single fonts (all the information of which TeX needs resides in TFM files). For this, the NFSS provides two commands \DeclareFontFamily and \DeclareFontShape. The former command just declares a new font family, and the latter associates fonts with a family. Font definitions are usually stored in .fd files, which are read on demand by LaTeX. For instance, if you use the default Computer Modern Roman font (font family cmr) in the standard OT1 encoding (as you do in your document), LaTeX looks for a file ot1cmr.fd (which is part of the LaTeX base) and reads this file. In this file, you find the following font definition:

\DeclareFontShape{OT1}{cmr}{m}{n}%
{<5><6><7><8><9><10><12>gen*cmr%
<10.95>cmr10%
<14.4>cmr12%
<17.28><20.74><24.88>cmr17}{}


This tells LaTeX that the cmr font can be used in sizes 5, 6, 7, 8, 9, 10, 10.95, 12, 14.4, 17.28 and so on. The gen function appends the size to the font name, so that for example in size 5 the font cmr5 is used, while for sizes 12 and 14.4 the font cmr12 is used. This definition has historical reasons. The original Compute Modern fonts are bitmap fonts (designed in Metafont), which are not freely scalable. Instead, they exist in different optical sizes, the smallest of them having a design size of 5 points. Now, if your document request the fonts in a size smaller than 5 points, LaTeX will not find this size in the font definition and instead use the smallest size that is defined (5 points).

For freely scalable font (e.g. PostScript Type1 or TrueType fonts), LaTeX can be told to scale the font to the requested size. For instance, the following font definition tells LaTeX to use the font cmr10 whenever the cmr family is selected in OT1 encoding, medium weight and roman shape:

\DeclareFontShape{OT1}{cmr}{m}{n}{ <-> cmr10 }


The fonts are simply scaled to the requested size. The fix-cm package alters the font definitions for the cmr family in such a way (although it does not use the same font for all sizes). Similarly, the exscale packages alters the definitions for the Computer Modern math extension font, so that they can be used in larger sizes.

Update: Only now, I noticed the following code in your preamble:

\DeclareMathSizes{\f@size}{\f@size}{0.6\f@size}{0.3\f@size}


This does not work as you have probably expected. \f@size is a macro that expands to 10 in the preamble (the standard font size) and not a TeX length. Hence, 0.6\f@size expands to 0.610, not 0.6 times the value of \f@size. Therefore, your definition is equivalent to:

\DeclareMathSizes{10}{10}{0.610}{0.310}


This declaration is the reason why you get a warning that some fonts are not available in sizes 0.610 and 0.310. (When you load fix-cm, you will see that in the normalfont example the limits of the integral sign and the exponent disappear because they are too small).

-

If you want to be able to scale text in math mode, you need to include the exscale package.

-

\usepackage{exscale,fix-cm} % allow Computer Modern fonts of all sizes

AFAIK, fix-cm is quite enough for text. In '3.4.3 Usage notes' of manual of fixltx2e: 'The packages type1cm and type1ec must not be loaded additionally'. And as is said by @You, exscale is more important here. –  Leo Liu Jul 23 '11 at 18:40
you need exscale and fix-cm –  Herbert Jul 23 '11 at 18:45
@Leo: I removed the package type1cm from my answer, as per the fixltx2e documentation. @Herbert: Thanks. –  Werner Jul 23 '11 at 18:50