summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/typeface/typeface-test.tex
blob: 2a7550dacd9a66fc00904a51d3f2be4f8f19c348 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
%-------- Typeface Package Test Harness -- User-configurable Section ----------
%
\providecommand*\TFTESTdocumentclass{article}   % or memoir, scrartcl, etc.

\providecommand*\TFTESTfontfamily{rm}           % set to rm, sf or tt
\providecommand*\TFTESTfontsize{10pt}           % 11pt, 12pt, others if memoir
\providecommand*\TFTESTpapersize{a4paper}

\providecommand*\TFTESTfontencoding{default}
\providecommand*\TFTESTinputencoding{default}
\providecommand*\TFTESTtextcomp{default}
\providecommand*\TFTESTcmap{default}
\providecommand*\TFTESTtypeface{default}
\providecommand*\TFTESTtextfigures{default}
\providecommand*\TFTESTsanstypeface{default}
\providecommand*\TFTESTmonotypeface{default}
\providecommand*\TFTESTmathtypeface{default}
\providecommand*\TFTESTsymbolstypeface{default}
\providecommand*\TFTESTfontloadorder{default}

\providecommand*\TFTESTdebug{false}
\providecommand*\TFTESTprintmathfonts{false}
\providecommand*\TFTESTincludemicrotype{true}
%
%--------------- End User-configurable Section --------------------------------

% Note that this document attempts to typeset text in many font weights,
% widths, shapes, variants, encodings and sizes. It calls on, e.g.,
% \oldstylenums regardless of loaded font. Line lengths in tables do not take
% account of actual page line width. Thus, depending on the font families you
% load, you should expect to receive several, if not many, warnings and
% overfull boxes. Do not be concerned (unless, of course, something is
% actually wrong).

\documentclass[\TFTESTfontsize,\TFTESTpapersize]{\TFTESTdocumentclass}
\usepackage[margin=1.0cm,
           %showframe,
           ]{geometry}

\usepackage{ifthen}
\usepackage{parskip}

% Microtype is required for substitute figures letterspacing in textnums
% environments (advance usage). However, note that microtype doesn't partner
% well with bitmap fonts, especially if any scaling is involved. In these
% cases, microtype will very likely throw "auto expansion is only possible
% with scalable fonts" errors.
\ifthenelse{\equal{\TFTESTincludemicrotype}{true}}{
  \usepackage[verbose=errors]{microtype}
}{}

\usepackage[
  fontencoding=\TFTESTfontencoding,
  inputencoding=\TFTESTinputencoding,
  textcomp=\TFTESTtextcomp,
  cmap=\TFTESTcmap,
  typeface=\TFTESTtypeface,
  textfigures=\TFTESTtextfigures,
  mathtypeface=\TFTESTmathtypeface,
  symbolstypeface=\TFTESTsymbolstypeface,
  sanstypeface=\TFTESTsanstypeface,
  monotypeface=\TFTESTmonotypeface,
  fontloadorder=\TFTESTfontloadorder,
  debug=\TFTESTdebug,
  printinfo=true,
]{typeface}

% Redefine equation numbering simply for testing's sake
\DeclareRobustCommand*\theequation{%
  \ifthenelse{\equal{\TFTESTfontfamily}{rm}}{%
    \protect\begin{textnums}3.\arabic{equation}\protect\end{textnums}%
  }{%
    \ifthenelse{\equal{\TFTESTfontfamily}{sf}}{%
      4.\arabic{equation}%
    }{% \TFTESTfontfamily=tt
      5.\arabic{equation}%
    }%
  }%
}

% While we're at it, redefine our equation numbering presentation
% format, again for testing's sake
\makeatletter\def\@eqnnum{{(\theequation)}}\makeatother

\usepackage{bookmark}[2010/04/08]

\ifthenelse{\equal{\TFTESTfontfamily}{rm}}{
  \newcommand*\TFbookmark{\rmprintname}
}{
  \ifthenelse{\equal{\TFTESTfontfamily}{sf}}
    {\newcommand*\TFbookmark{\sfprintname}}
    {\newcommand*\TFbookmark{\ttprintname}}
}

\ifthenelse{\equal{\TFTESTfontfamily}{rm}}
  {\def\typeface{typeface}\def\typefacename{\textrm{\TFTESTtypeface}}}{}%
\ifthenelse{\equal{\TFTESTfontfamily}{sf}}
  {\def\typeface{sanstypeface}\def\typefacename{\textsf{\TFTESTsanstypeface}}}{}%
\ifthenelse{\equal{\TFTESTfontfamily}{tt}}
  {\def\typeface{monotypeface}\def\typefacename{\texttt{\TFTESTmonotypeface}}}{}%

\begin{document}
  \hypertarget{\TFbookmark}{}
  \bookmark[dest=\TFbookmark, level=0]{\TFbookmark}
  \pagestyle{empty}
  \raggedbottom
  \section*{Test page: \typeface\(=\)\typefacename \space{(\TFTESTfontsize)}}
  \tfprintpackageoptions%
  \tfprintinfo%
  \tfprinttext{\TFTESTfontfamily}%
  \tfprintfigures{\TFTESTfontfamily}%
  \tfprintmathsample{\TFTESTfontfamily}%
  \tfprintmathalphabets{\TFTESTfontfamily}%
  \ifthenelse{\equal{\TFTESTprintmathfonts}{true}}{\tfprintmathfonts}{}%
  \tfprinttextsample{\TFTESTfontfamily}%
  \tfprinttextalphabets%
  {\noindent\footnotesize{\rmfamily\selectfont $footnotesize$footnotesize}%
  {\sffamily\selectfont footnotesize}%
  {\ttfamily\selectfont footnotesize}%
  {\rmfamily\selectfont$0123456789$\begin{textnums}0123456789\end{textnums}}%
  {\sffamily\selectfont\begin{textnums}0123456789\end{textnums}}%
  {\ttfamily\selectfont\begin{textnums}0123456789\end{textnums}}}\\%
  {\normalsize{\rmfamily\selectfont $Normal$Normal}%
  {\sffamily\selectfont Normal}%
  {\ttfamily\selectfont Normal}%
  {\rmfamily\selectfont$0123456789$\begin{textnums}0123456789\end{textnums}}%
  {\sffamily\selectfont\begin{textnums}0123456789\end{textnums}}%
  {\ttfamily\selectfont\begin{textnums}0123456789\end{textnums}}}\\%
  {\Large{\rmfamily\selectfont $Large$Large}%
  {\sffamily\selectfont Large}%
  {\ttfamily\selectfont Large}%
  {\rmfamily\selectfont$0123456789$\begin{textnums}0123456789\end{textnums}}%
  {\sffamily\selectfont\begin{textnums}0123456789\end{textnums}}%
  {\mbox{\ttfamily\selectfont\begin{textnums}0123456789\end{textnums}}}}\\%
\end{document}