I can't see what's wrong with scaling the main font:
\documentclass{article}
\usepackage{fontspec}
\setmainfont[Ligatures=TeX,Scale=0.95]{Linux Libertine O}
\usepackage{blindtext}
\linespread{0.95833} % 11.5/12
\begin{document}
\blinddocument
\end{document}
With \Large
you'll get 13.4 instead of 14pt; it doesn't seem a big difference (and I'd say it's even better). At \Huge
the font will be 24pt instead of 25pt.
This can be supplemented by appropriate \DeclareMathSizes
commands, where the last three arguments are scaled at 95%:
\DeclareMathSizes{5}{4.75}{4.75}{4.75}
\DeclareMathSizes{6}{5.7}{4.75}{4.75}
\DeclareMathSizes{7}{6.65}{4.75}{4.75}
\DeclareMathSizes{8}{7.6}{5.7}{4.75}
\DeclareMathSizes{9}{8.55}{5.7}{4.75}
\DeclareMathSizes{\@xpt}{9.5}{6.65}{4.75}
\DeclareMathSizes{\@xipt}{10.4}{7.6}{5.7}
\DeclareMathSizes{\@xiipt}{11.4}{7.6}{5.7}
\DeclareMathSizes{\@xivpt}{13.68}{9.5}{6.65}
\DeclareMathSizes{\@xviipt}{16.42}{11.4}{9.5}
\DeclareMathSizes{\@xxpt}{19.7}{13.68}{11.4}
\DeclareMathSizes{\@xxvpt}{23.64}{19.7}{16.42}
The font isn't really scaled down, it just isn't scaled up as much as you expected.
There are several factors.
Firstly the class options 10pt
, 11pt
, 12pt
are not lengths they are simply the names of options specifically in article
class, they correspond to the files size10.clo
, size11.clo
and size12.clo
. This means that you can not use other lengths (such as 11bp
) but also that the names themselves do not necessarily correspond to any particular parameter being set to those lengths, all kinds of parameters are set, spacing around lists, sizes of fonts at all the sizes such as \small
, \large
, etc.
Secondly as you note a TeX point (pt
) is smaller than a PostScript point (bp
) by a factor of 72/72.27.
Thirdly TeX font sizes are traditionally arranged in magstep
sequence, that is, the base size of 10pt multiplied by a power of sqrt(1.2), so 12pt is 12pt but 11pt you see this in the macros LaTeX uses for all the common font sizes
\def\@xpt{10}
\def\@xipt{10.95}
\def\@xiipt{12}
\def\@xivpt{14.4}
\def\@xviipt{17.28}
\def\@xxpt{20.74}
\def\@xxvpt{24.88}
This geometric scaling is probably still a good discipline although it's not as important using scalable fonts as it was with the original metafont fonts where scaling was not such a "free" operation, and for any scaled size the system then a pk font containing bitmaps for all the glyphs at the requested size needed to be generated.
The TeXBook says:
\danger At many computer centers it has proved convenient to supply fonts
at magnifications that grow in geometric ratios---something like equal-tempered
tuning on a ^{piano}. The idea is to have all fonts available at their true
size as well as at magnifications 1.2 and~1.44 (which is $1.2\times1.2$);
perhaps also at magnification~1.728 ($=1.2\times1.2\times1.2$) and even
higher. Then you can magnify an entire document by 1.2 or~1.44 and still
stay within the set of available fonts. Plain \TeX\ provides the
abbreviations ^|\magstep||0| for a scale factor of 1000, |\magstep1| for a
scaled factor of 1200, |\magstep2| for 1440, and so on up to |\magstep5|.
You say, for example,
\begintt
\font\bigtenrm=cmr10 scaled\magstep2
\endtt
to load font |cmr10| at $1.2\times1.2$ times its normal size.
Best Answer
You asked, "Where do
\fontsize
and\selectfont
come from? Are the[y] LaTeX primitives? Are they part of a library?"Both macros are defined by the LaTeX2e kernel, or format. The term "primitive" [command] has a special meaning in TeX and LaTeX circles, so it's not wise to call
\fontsize
and\selectfont
"primitives".Just as the original "Plain TeX" format consists of a set of primitives (frequently, but not universally, referred to as "Knuth TeX") and a set of macros that build on these primitives (both the primitives and the aforementioned macros are explained in full detail in the TeXbook), the LaTeX2e format consists of a set of primitives (which these days come from eTeX, not Knuth TeX) and a set of macros defined in the LaTeX2e kernel. The LaTeX kernel may be found in the file
latex.ltx
.In the current version of
latex.ltx
("LaTeX2e <2021-06-01> patch level 1"), the macro\fontsize
is defined on lines 7036 and 7037 of the file, as follows:The macro
\set@fontsize
is defined on lines 7985 thru 8002 as follows:The macro
\selectfont
, in turn, is defined on lines 7954 thru 7985 as follows:As the code demonstrates, both macros are quite complex and rely on a sizable number of subsidiary macros to get much of their work done.
You also asked, "Why does
fontspec
not handle this?" As @UlrikeFischer and @Cicada have already pointed out in comments, there's no need or justifiable reason for makingfontspec
perform tasks that are handled perfectly well by the existing LaTeX macros\fontsize
and\selectfont
.