[Tex/LaTex] Scrartcl 13.999 point 14.4 point but not 14 point

font-metricsfontsizefontspecformattingkoma-script

Can the scrartcl class make a true 14 point type?

It will produce 13.999pt, 13.9999pt and 13.99998pt, but 14pt produces 14.4 point type only.

Thanks 🙂

\documentclass[fontsize=13.999pt]{scrartcl}
\usepackage[letterpaper]{geometry}
\usepackage{fontspec}
\setmainfont{Vollkorn}

   \makeatletter

\def\showfontsize{\f@size{} point}

    \makeatother

\begin{document}

  \showfontsize 

\end{document}

enter image description here

Changing the fontsize to 14pt:

\documentclass[fontsize=14.000pt]{scrartcl}

Produces:

enter image description here

Also changing the fontsize to 13.999999pt, 13.9999999pt, 13.99999999pt, and so on, also results in 14.4pt type.

Strangely enough this:

\documentclass[fontsize=14.00001pt]{scrartcl}

Produces:

enter image description here

and this:

\documentclass[fontsize=14.000001pt]{scrartcl}

Produces:

enter image description here

Closely related: How can i change the fontsize with KOMA-script?

Related: Scrbook: Using fallback calculation to setup font sizes

Best Answer

KOMA-Script supports several ways to set the font size. First of all, if you want fontsize=<value> it tries to load a font size definition file \@fontsizefilebase<value>.clo. If this is not found, it tries \@fontsizefilebase<value>pt.clo. If this is not found, it tries size<adapted value>.clo. <adapted value> is the font size in pt but with stripped pt, it results, e.g., in 10 for 10pt, 11 for 11pt, and 14 for 14pt. Last but not least KOMA-Script provides a fallback calculation for font sizes without font size definition files.

The default for \@fontsizefilebase is scrsize, but you can change it before \documentclass.

So with fontsize=14pt, scrartcl searches for scrsize14pt.clo and size14.clo. If you have installed package extsizes, it will find size14.clo. There you can find:

\renewcommand\normalsize{%
   \@setfontsize\normalsize\@xivpt{17}%

and in the LaTeX kernel:

\def\@xivpt{14.4}

This is the reason for getting 14.4pt instead of 14pt.

If you really want 14pt, you need to make your own font size definition file. You can use scrsize10pt.clo, rename it and change the values. Or you can use:

\documentclass{scrartcl}
\usepackage{scrfontsizes}
\generatefontfile{afsize}{14pt}

\begin{document}
Test
\end{document}

to generate afsize14pt.clo. After generating the font definition file:

\makeatletter
\newcommand*{\@fontsizefilebase}{afsize}
\makeatother
\documentclass[fontsize=14pt]{scrartcl}
\usepackage[letterpaper]{geometry}
\usepackage{fontspec}

\makeatletter
\def\showfontsize{\f@size{} point}
\makeatother

\begin{document}

\showfontsize 

\end{document}

Will result in:

14 point

Last but not least

\documentclass[letterpaper,fontsize=14pt]{scrartcl}
\KOMAoptions{fontsize=14pt}

\makeatletter
\def\showfontsize{\f@size{} point}
\makeatother

\begin{document}

\showfontsize 

\end{document}

Would also result in using 14pt, because \KOMAoptions{fontsize=14pt} uses the fall back calculation. This is the same font size calculation, that is used by \generatefontsizes. Nevertheless, in this example initialisation of some load time lengths of scrartcl could be done with, e.g., the font size of size14.clo. So combining both methods would be a save solution, if your document needs at least two LaTeX runs:

\makeatletter
\newcommand*{\@fontsizefilebase}{afsize}% setup prefix of font declaration files
\makeatother
\documentclass[letterpaper,fontsize=14pt]{scrartcl}
% Generate and use the font size declaration file, if is does not exist
\IfFileExists{\csname @fontsizefilebase\endcsname 14pt.clo}{}{%
  \usepackage{scrfontsizes}
  \generatefontfile{afsize}{14pt}
  \KOMAoptions{fontsize=14pt}
}

\begin{document}

\csname f@size\endcsname\ point 

\end{document}