summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/fontaxes/test-fontaxes.tex
blob: e6c8ff185824266d0b47b532fa43533e8713f213 (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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
%%
%% This is file `test-fontaxes.tex',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% fontaxes.dtx  (with options: `test')
%% 
%% Copyright (c) 2007 by Andreas Buehmann
%% Copyright (c) 2011 by Michael Ummels <michael.ummels@rwth-aachen.de>
%% 
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3c
%% of this license or (at your option) any later version.
%% The latest version of this license is in
%%   http://www.latex-project.org/lppl.txt
%% and version 1.3 or later is part of all distributions of LaTeX
%% version 2005/12/01 or later.
%% 
%% This work has the LPPL maintenance status `maintained'.
%% 
%% The Current Maintainer of this work is Michael Ummels.
%% 
%% This work consists of the files fontaxes.dtx, fontaxes.ins and
%% the derived files fontaxes.sty, test-fontaxes.tex and fontaxes.pdf.
%% 
\documentclass[a4paper]{article}
\usepackage{MinionPro}
\usepackage[T1]{fontenc}

\usepackage{longtable}
\usepackage{fontaxes}
\usepackage{hyperref}

\makeatletter
\newcommand\showshape{\hphantom{\normalfont\textsuperscript{sscsw}}%
  \llap{\expandafter\normalfont\expandafter\textsuperscript
  \expandafter{\f@shape}}}

\newcommand\shapecmdlist{\upshape,\itshape,\slshape,\swshape,%
  \ulcshape,\scshape,\sscshape}
\newcommand\reacheableshapes{}
\newtoks\tab
\newcommand\atab[1]{%
  \tab\expandafter{\the\tab#1}%
}
\newcommand\etab[1]{%
  \edef\line{#1}%
  \expandafter\atab\expandafter{\line}%
}
\newif\ifadded
\newcommand\testall{%
  \edef\reacheableshapes{\shapedefault}
  \addedtrue
  \@whilesw\ifadded\fi{%
    \addedfalse
    \@for\@sh:=\reacheableshapes\do{%
      \begingroup
        \fontshape\@sh\relax
        \@for\@cmd:=\shapecmdlist\do{%
          \@cmd\relax
          \@expandtwoargs\in@{,\f@shape,}{,\reacheableshapes,}%
          \ifin@\else
            \xdef\reacheableshapes{\reacheableshapes,\f@shape}%
            \global\addedtrue
          \fi
        }%
      \endgroup
    }%
  }
  \tab{\begin{longtable}[t]{ll}}
  \@for\@sh:=\reacheableshapes\do{%
    \etab{\noexpand\fontshape{\@sh}}%
    \atab{\selectfont\showshape Am Anfang &}%
    \etab{\noexpand\fontshape{\@sh}}%
    \atab{\begin{tabular}[t]{ll}}%
    \@for\@cmd:=\shapecmdlist\do{%
      \atab{\normalfont\ttfamily}%
      \etab{\expandafter\string\@cmd &
        \expandafter\noexpand\@cmd\noexpand\showshape war das Wort%
        \noexpand\\\relax}%
    }%
    \atab{\end{tabular} \\\relax}%
  }
  \atab{\end{longtable}\endgraf}%
  \the\tab
}

\makeatother
\parindent=0pt

\begin{document}

\section{Shape}
\subsection{Switches}
\fontbasefamily{MinionPro}\selectfont
\figureversion{text,proportional}%
\testall

\subsection{Text font commands}

\makeatletter
\def\amp{&}
\def\visible#1#2\\{%
  #1#2 \amp {\def\@tempa{#1}\edef\@tempa{\expandafter
  \strip@prefix\meaning\@tempa}\normalfont\ttfamily{\@tempa}}\\}
\makeatother
\begin{tabular}{ll}
Am \visible{\textit{Anfang \textsc{war}}} das Wort\\
Am \visible{\textsl{Anfang \textulc{war}}} das Wort\\
Am \visible{\textsw{Anfang \textssc{war}}} das Wort\\
Am \visible{\textsc{Anfang \textsl{war}}} das Wort\\
Am \visible{\textssc{Anfang \textit{war}}} das Wort\\
\end{tabular}

\section{Figure version}

\tracingmacros=2
\begin{tabular}{lll}
\visible\txfigures 12345 \visible\lnfigures 67890\\
\visible\txfigures 12345 \visible\tbfigures 67890\\
\visible\txfigures 12345 \visible\prfigures 67890\\
\visible\txfigures 12345 \visible\txfigures 67890\\
\visible\lnfigures 12345 \visible\lnfigures 67890\\
\visible\lnfigures 12345 \visible\tbfigures 67890\\
\visible\lnfigures 12345 \visible\prfigures 67890\\
\visible\lnfigures 12345 \visible\txfigures 67890\\
\visible\tbfigures 12345 \visible\lnfigures 67890\\
\visible\tbfigures 12345 \visible\tbfigures 67890\\
\visible\tbfigures 12345 \visible\prfigures 67890\\
\visible\tbfigures 12345 \visible\txfigures 67890\\
\visible{\tbfigures\lnfigures}12345
  \visible\lnfigures 67890\\
\visible{\tbfigures\lnfigures}12345
  \visible\tbfigures 67890\\
\visible{\tbfigures\lnfigures}12345
  \visible\prfigures 67890\\
\visible{\tbfigures\lnfigures}12345
  \visible\txfigures 67890\\
\end{tabular}

\begingroup
\figureversion{osf,lf,tab,prop,  tabular,proportional   ,  text  ,lining,
non-existent}
\endgroup

\subsection{Switch base family}

\begingroup
\def\nums{1234567890\par}
\txfigures MinionPro \nums
\fontbasefamily{ppl}\selectfont
Palatino \nums
\lnfigures
lining \nums
\fontbasefamily{MinionPro}\selectfont
MinionPro \nums
\figureversion{lining,tabular}%
lining and tabular \nums
\fontbasefamily{ppl}\selectfont
Palatino \nums
\txfigures
text \nums
\fontbasefamily{MinionPro}\selectfont
MinionPro again, should be text \emph{and tabular} \nums
\endgroup

\subsection{Text font commands}

\def\nums{t123 $m123$}
\begin{tabular}{lll}
\nums\quad\visible{(\textfigures{\nums})}\quad \nums\\
\nums\quad\visible{(\liningfigures{\nums})}\quad \nums\\
\nums\quad\visible{(\tabularfigures{\nums})}\quad \nums\\
\nums\quad\visible{(\proportionalfigures{\nums})}\quad \nums\\
\nums\quad\visible{(\tabularfigures{\liningfigures{\nums}})}\quad \nums\\
\end{tabular}

\begingroup Same but start from lining tabular figures\par
\lnfigures\tbfigures
\begin{tabular}{lll}
\nums\quad\visible{(\textfigures{\nums})}\quad \nums\\
\nums\quad\visible{(\liningfigures{\nums})}\quad \nums\\
\nums\quad\visible{(\tabularfigures{\nums})}\quad \nums\\
\nums\quad\visible{(\proportionalfigures{\nums})}\quad \nums\\
\nums\quad\visible{(\tabularfigures{\liningfigures{\nums}})}\quad \nums\\
\end{tabular}
\endgroup

\subsection{In moving argument: o123 \liningfigures{l456}
  \tabularfigures{t789}
  \figureversion{text,text,lining,text,proportional}op012 \textsw{Swash}
  \textssc{Spaced \textulc{Small} Caps}}

\tableofcontents

\section{Math version}

\def\formula{$123 + a - \sqrt{\beta}$}
\begin{tabular}{lll}
\visible\unboldmath \formula\quad \visible\boldmath \formula\\
\visible\unboldmath \formula\quad \visible\tabularmath \formula\\
\visible\unboldmath \formula\quad \visible\proportionalmath \formula\\
\visible\unboldmath \formula\quad \visible\unboldmath \formula\\
\visible\boldmath \formula\quad \visible\boldmath \formula\\
\visible\boldmath \formula\quad \visible\tabularmath \formula\\
\visible\boldmath \formula\quad \visible\proportionalmath \formula\\
\visible\boldmath \formula\quad \visible\unboldmath \formula\\
\visible\tabularmath \formula\quad \visible\boldmath \formula\\
\visible\tabularmath \formula\quad \visible\tabularmath \formula\\
\visible\tabularmath \formula\quad \visible\proportionalmath \formula\\
\visible\tabularmath \formula\quad \visible\unboldmath \formula\\
\visible{\tabularmath\boldmath}\formula\quad \visible\boldmath \formula\\
\visible{\tabularmath\boldmath}\formula\quad \visible\tabularmath \formula\\
\visible{\tabularmath\boldmath}\formula\quad \visible\proportionalmath \formula\\
\visible{\tabularmath\boldmath}\formula\quad \visible\unboldmath \formula\\
\end{tabular}

\section{Recovery}

\makeatletter
\def\showfont{\edef\@tempa{\curr@fontshape}\hfill
{\normalfont\ttfamily\@tempa}}
\def\showmath{$123xyz$ \edef\@tempa{\math@version}\hfill
{\normalfont\ttfamily\@tempa}}
\makeatother

\begingroup
\scshape scshape \showfont\par
\fontshape{scit}\selectfont selecting scit explicitly \showfont\par
\sscshape Sscshape should adapt\showfont\par
\endgroup

\bigskip
\begingroup
\boldmath boldmath \showmath\par
\mathversion{tabular} selecting tabular explicitly \showmath\par
\boldmath boldmath \showmath\par
\endgroup

\bigskip
\begingroup
\fontfamily{MinionPro-LF}\selectfont selecting MinionPro-LF explicitly \showfont\par
\tbfigures tabularfigures 1234 \showfont\par
\endgroup

\bigskip
\begingroup
\tbfigures tabularfigures 1234 \showfont\par
\fontfamily{pplx}\selectfont selecting pplx explicitly \showfont\par
\txfigures textfigures 1234 \showfont\par
\fontbasefamily{MinionPro}\selectfont
Back to MinionPro (is tabular still there?) 1234 \showfont\par
\fontfamily{ptm}\selectfont selecting ptm explicitly \showfont\par
\lnfigures liningfigures 1234 \showfont\par
\tbfigures tabularfigures 1234 \showfont\par
\fontbasefamily{MinionPro}\selectfont Back \dots 1234 \showfont\par
\endgroup

\end{document}
%% 
%%
%% End of file `test-fontaxes.tex'.