4

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?

4

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}
  • Thanks, this looks interesting. Does it have any side-effects? I'm asking because the documentation mentions specifically that this package fixes Computer Modern. Is it the case that it fixes it in general for T1 fonts and that my later definition of the font makes any more specific CM-related changes irrelevant? – Philip Leifeld Dec 4 '15 at 13:41
  • It will affect only the computer modern fonts and not disturb your own font definitions. – Ulrike Fischer Dec 4 '15 at 13:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.