| 1 |
% Copyright 2016-21 (c) Palle Joergensen |
| 2 |
% |
| 3 |
% This file is part of addfont. |
| 4 |
|
| 5 |
% addfont is free software: you can redistribute it and/or modify it |
| 6 |
% under the terms of the GNU General Public License as published by |
| 7 |
% the Free Software Foundation, either version 3 of the License, or |
| 8 |
% (at your option) any later version |
| 9 |
|
| 10 |
% addfont is distributed in the hope that it will be useful, but |
| 11 |
% WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 |
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 |
% General Public License for more details. |
| 14 |
|
| 15 |
% You should have received a copy of the GNU General Public License |
| 16 |
% along with addfont. If not, see <http://www.gnu.org/licenses/>. |
| 17 |
\documentclass[12pt,british,parskip=half]{scrartcl} |
| 18 |
\usepackage[utf8]{inputenc} % |
| 19 |
\usepackage{babel} % |
| 20 |
\usepackage{kpfonts} % |
| 21 |
\usepackage{listings} % |
| 22 |
\usepackage[T1]{fontenc} % |
| 23 |
\usepackage{addfont} % |
| 24 |
\title{\texttt{addfont.sty} -- easier use of fonts without \LaTeX\ |
| 25 |
support.} \author{Palle Jørgensen} |
| 26 |
\lstset{language={[latex]tex},frame=single,morekeywords={addfont,addshape,*}} |
| 27 |
\addfont[1.2][\hyphenchar\font-1]{OT1}{cmtt5}{\cmtt} |
| 28 |
\addfont{OT1}{cmr5}{\cmr} \addshape{m}{it}{cmti5} |
| 29 |
\date{Version 1.1, \today} |
| 30 |
|
| 31 |
\begin{document} |
| 32 |
\maketitle |
| 33 |
|
| 34 |
\section{Introduction} |
| 35 |
\label{sec:introduction} |
| 36 |
|
| 37 |
This package is intended for use by users who know about fonts. It is |
| 38 |
a quick-fix for fonts which does not have genuine \LaTeX\ support. It |
| 39 |
is \emph{not} meant as a replacement of the \LaTeX\ font definition |
| 40 |
files. |
| 41 |
|
| 42 |
It is meant as something more useable for \LaTeX\ users than the |
| 43 |
\lstinline+\newfont+ command. With addfont the loaded font scales |
| 44 |
along with the usual \LaTeX\ size selection. |
| 45 |
|
| 46 |
Using this package still requires some knowledge on how to use fonts |
| 47 |
with \LaTeX. |
| 48 |
|
| 49 |
\section{Usage} |
| 50 |
\label{sec:usage} |
| 51 |
|
| 52 |
To load the package type |
| 53 |
\begin{lstlisting} |
| 54 |
\usepackage{addfont} |
| 55 |
\end{lstlisting} |
| 56 |
into your preamble. |
| 57 |
|
| 58 |
\subsection{Loading a font} |
| 59 |
\label{sec:loading-font} |
| 60 |
|
| 61 |
To load a font you must know the encoding and the filename of the font. |
| 62 |
|
| 63 |
Typing |
| 64 |
\begin{lstlisting} |
| 65 |
\addfont{OT1}{cmr5}{\cmr} |
| 66 |
\end{lstlisting} |
| 67 |
makes a command `\lstinline|\cmr|' which loads the font |
| 68 |
`\lstinline|cmr5|'. The font is in the encoding `\lstinline|OT1|'. |
| 69 |
|
| 70 |
\lstinline|\addfont| now defines a font family for the font and creates |
| 71 |
a command that loads the font. |
| 72 |
|
| 73 |
Typing |
| 74 |
\begin{lstlisting}[morekeywords=cmr] |
| 75 |
\cmr The quick brown fox jumps over the lazy dog |
| 76 |
\end{lstlisting} |
| 77 |
in your document yields |
| 78 |
|
| 79 |
{\cmr The quick brown fox jumps over the lazy dog} |
| 80 |
|
| 81 |
\subsection{Other shapes} |
| 82 |
\label{sec:other-shapes} |
| 83 |
|
| 84 |
To define another shape of the font type |
| 85 |
\begin{lstlisting} |
| 86 |
\addshape{m}{it}{cmti5} |
| 87 |
\end{lstlisting} |
| 88 |
where `\lstinline|m|' is the font series and `\lstinline|it|' is the |
| 89 |
font shape. `\lstinline|cmti5|' is the filename of the font. |
| 90 |
|
| 91 |
as \lstinline|addshape| remembers the encoding and family of the last |
| 92 |
added font this is not typed. |
| 93 |
|
| 94 |
The new shape is now ready for use. Typing |
| 95 |
\begin{lstlisting}[morekeywords=cmr] |
| 96 |
\cmr\itshape The quick brown fox jumps over the lazy dog |
| 97 |
\end{lstlisting} |
| 98 |
into your document now yields |
| 99 |
|
| 100 |
{\cmr\itshape The quick brown fox jumps over the lazy dog} |
| 101 |
|
| 102 |
\subsection{Fine tuning the font} |
| 103 |
\label{sec:fine-tuning-font} |
| 104 |
|
| 105 |
There are some optional arguments to \lstinline|\addfont| to fine |
| 106 |
tunig the font: |
| 107 |
\begin{lstlisting} |
| 108 |
\addfont[1.2][\hyphenchar\font-1]{OT1}{cmtt5}{\cmtt} |
| 109 |
\end{lstlisting} |
| 110 |
The font is now scaled by a factor of 1.2 and the hyphenchar is set to |
| 111 |
$-1$ (hyphenation not allowed). |
| 112 |
|
| 113 |
{\cmtt\itshape The quick brown fox jumps over the lazy dog} |
| 114 |
|
| 115 |
Scaling is mostly for using a mix fonts of fonts not originalle |
| 116 |
designed to be used together. |
| 117 |
|
| 118 |
\subsection{Generic description} |
| 119 |
\label{sec:generic-description} |
| 120 |
|
| 121 |
The general scheme is |
| 122 |
\begin{lstlisting} |
| 123 |
\addfont[scale][cmds]{encoding}{font name}{\macro} |
| 124 |
\end{lstlisting} |
| 125 |
|
| 126 |
where |
| 127 |
\begin{description} |
| 128 |
\item[scale] is the factor to scale the font. This is normally not |
| 129 |
necesary. |
| 130 |
\item[cmds] are commands to be executed at font selection. Typically |
| 131 |
setting the hyphen char of a monospaced font and nothing for other |
| 132 |
types of fonts. |
| 133 |
\item[encoding] is the encoding scheme of the font. |
| 134 |
\item[font name] is the file name of the \texttt{tfm}-file of the font |
| 135 |
without the \texttt{tfm} extension. |
| 136 |
\item[\textbackslash macro] is the macro to use the font. |
| 137 |
\end{description} |
| 138 |
|
| 139 |
The general font shape scheme is |
| 140 |
\begin{lstlisting} |
| 141 |
\addshape[cmds]{series}{shape}{font name} |
| 142 |
\end{lstlisting} |
| 143 |
|
| 144 |
where |
| 145 |
\begin{description} |
| 146 |
\item[cmds] are commands to be executed at font selection. Typically |
| 147 |
nothing. |
| 148 |
\item[series] is the font series. |
| 149 |
\item[shape] is the font shape. |
| 150 |
\item[font name] is the file name of the \texttt{tfm}-file of the font. |
| 151 |
\end{description} |
| 152 |
|
| 153 |
\subsection{Font size selection} |
| 154 |
\label{sec:font-size-selection} |
| 155 |
|
| 156 |
The \lstinline|addfont| by default sets up to font to be used with a |
| 157 |
fixed set of sizes. The sizes are the sizes normally used for the |
| 158 |
Computer Modern fonts, 5pt, 6pt, 7pt, 8pt, 9pt, 10pt, 10.95pt, 12pt, |
| 159 |
14.4pt, 17.28pt, 20.74pt, and 24.88pt respectively. |
| 160 |
|
| 161 |
To use a font at \emph{any} size replace \lstinline|addfont| with |
| 162 |
\lstinline|addfont*|. |
| 163 |
|
| 164 |
\section{Limitations} |
| 165 |
\label{sec:limitations} |
| 166 |
|
| 167 |
As written in the introduction this package is not meant as a |
| 168 |
replacement of writing customized \LaTeX\ font definition files. Thus |
| 169 |
it does not provide all the features of \LaTeX\ font selection. |
| 170 |
|
| 171 |
\section{License} |
| 172 |
\label{sec:license} |
| 173 |
|
| 174 |
\texttt{addfont} i copyright \textcopyright\ Palle Jørgensen, |
| 175 |
2016-21 |
| 176 |
|
| 177 |
\texttt{addfont} is free software: you can redistribute it and/or |
| 178 |
modify it under the terms of the GNU General Public License as |
| 179 |
published by the Free Software Foundation, either version 3 of the |
| 180 |
License, or (at your option) any later version. |
| 181 |
|
| 182 |
\texttt{addfont} is distributed in the hope that it will be useful, |
| 183 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 184 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 185 |
General Public License for more details. |
| 186 |
|
| 187 |
You should have received a copy of the GNU General Public License |
| 188 |
along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 189 |
|
| 190 |
\end{document} |