[Tex/LaTex] Setting fontsize in scrbook class

fontsfontsizekoma-script

I currently use the scrbook class with a custom TrueType font that I included manually. The font is called GARA (a Garamond variant), and I have written an .fd file etc. for it. The font is scalable, such that half-point sizes are allowed, e.g., 10.5 pt.

So far, this works well, and I can use this font in my document, also with font size 10.5 pt. However, I have a hard time making this the default font size in the whole document. See code below:

\documentclass[a4paper,fontsize=10.5pt]{scrbook}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\renewcommand{\encodingdefault}{T1}
\renewcommand{\rmdefault}{GARA}

\addtokomafont{disposition}{\rmfamily}
\addtokomafont{disposition}{\mdseries}

\begin{document}

My test.

\end{document}

Here, I am trying to set the font size of the document right in the beginning, but the GARA font is only loaded after that. I assume therefore the package is originally loaded with the default font, which is not available in 10.5 pt, and this causes the following warnings:

scrbook.cls:2152: Font shape `OT1/cmr/m/n' in size <10.5> not available(Font) size <10.95> substituted on input line 2152.
typearea.sty:0: DIV for 10.5pt and used papersize(typearea) not defined!(typearea) Using DIV=1.
Size substitutions with differences(Font) up to 0.45pt have occurred.

How can I either set the fontsize option after selecting the font or select the font before setting the fontsize option or suppress the warning messages?

Best Answer

You can load the fix-cm package to avoid such size substituations and the accompaigning warnings:

\RequirePackage{fix-cm}
\documentclass[a4paper,fontsize=10.5pt]{scrbook}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\renewcommand{\encodingdefault}{T1}
\renewcommand{\rmdefault}{GARA}

\addtokomafont{disposition}{\rmfamily}
\addtokomafont{disposition}{\mdseries}

\begin{document}

My test.

\end{document}
Related Question