summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/xetex/xetexfontinfo/AAT-info.tex
blob: e0ae839348e6d593bf8d8537da8f08b997a4f103 (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
%%% AAT-info.tex %%%
% By Jonathan Kew
%
% Prints XeTeX font features for a font
% using the "AAT" renderer of XeTeX;
% requires Mac OS X.
%
% See OpenType-info.tex for the equivalent
% functionality for OpenType fonts.
%
% Usage:
%   Type the name of the font below and compile this 
%   document with plain `xetex` to receive a listing
%   of the AAT font features supported by the chosen font.
%
% AAT-info is distributed under the Apache License v2: 
%   <http://www.apache.org/licenses/LICENSE-2.0.html>
%
%%%%%%%%%%%%%%%%%%%%
%
% Select the font name:
\def\myfontname{Hoefler Text}
%
%%% AAT-info.tex %%%


\font\testfont="\myfontname" at 10pt
\nopagenumbers

\baselineskip=14pt
\font\tenrm="Lucida Grande" at 10pt \tenrm
\font\title="Lucida Grande Bold" at 12pt

\font\sym="Apple Symbols" at 11pt
\def\radioOff{{\sym ^^^^25cb}}
\def\radioOn{{\sym ^^^^25c9}}
\def\checkOff{{\sym ^^^^2610}}
\def\checkOn{{\sym ^^^^2612}}

\newcount\nf
\newcount\f \newcount\fc
\newcount\ns
\newcount\s \newcount\sc
\nf=\XeTeXcountfeatures\testfont
\noindent {\title AAT features in ‘\myfontname’}\nobreak\medskip
\ifnum\nf>0
  \loop
    \fc=\XeTeXfeaturecode\testfont\f
    \noindent \XeTeXfeaturename\testfont\fc\ [\number\fc]
    \endgraf
    \ns=\XeTeXcountselectors\testfont\fc
    {
      \loop
      \sc=\XeTeXselectorcode\testfont\fc\s
      \textindent{%
        \ifnum\XeTeXisexclusivefeature\testfont\fc>0
          \ifnum\XeTeXisdefaultselector\testfont\fc\sc>0 \radioOn \else \radioOff \fi
        \else
          \ifnum\XeTeXisdefaultselector\testfont\fc\sc>0 \checkOn \else \checkOff \fi
        \fi
      }\XeTeXselectorname\testfont\fc\sc\ [\number\sc]
      \endgraf
      \advance\s by 1 \ifnum\s<\ns \repeat
    }
    \smallskip
  \advance\f by 1 \ifnum\f<\nf \repeat
\else
  \noindent {No AAT features available}\par
\fi

\bigskip

\newcount\val
\def\appendint{\count255=\val \divide\count255 by 65536
 \edef\decval{\decval\number\count255}\multiply\count255 by 65536
 \advance\val by -\count255 }
\def\decimalize#1{\val=#1 \def\decval{}\appendint \edef\decval{\decval.}%
 \multiply\val by 10 \appendint \multiply\val by 10 \appendint
 \multiply\val by 10 \appendint \multiply\val by 10 \appendint
 \multiply\val by 10 \appendint \multiply\val by 10 \appendint}
\def\decnum{\afterassignment\printdec \count255=}
\def\printdec{\dimen255=\count255 sp \expandafter\noPT\the\dimen255 }
{\catcode`\p=12 \catcode`\t=12 \gdef\noPT#1pt{#1}}
\newcount\nv
\newcount\v \newcount\vc
\nv=\XeTeXcountvariations\testfont
\noindent {\title AAT variation axes in \myfontname:}\nobreak\medskip
\ifnum\nv>0
  \loop
    \vc=\XeTeXvariation\testfont\v
    \noindent \XeTeXvariationname\testfont\vc
    \endgraf
    \indent Range:\ 
      {\decimalize{\XeTeXvariationmin\testfont\vc}%
       \font\x="\myfontname:\XeTeXvariationname\testfont\vc=\decval" at 10pt
       \x min \decnum\XeTeXvariationmin\testfont\vc}%
      \ …\ 
      {\decimalize{\XeTeXvariationmax\testfont\vc}%
       \font\x="\myfontname:\XeTeXvariationname\testfont\vc=\decval" at 10pt
       \x max \decnum\XeTeXvariationmax\testfont\vc}%
      \ \ 
      {\font\x="\myfontname" at 10pt
       \x (default:\ \decnum\XeTeXvariationdefault\testfont\vc)}%
      \endgraf
    \smallskip
  \advance\v by 1 \ifnum\v<\nv \repeat
\else
  \noindent {No AAT variations available}\par
\fi

\bigskip

\newcount\ng
\newcount\g \newcount\step
\ng=\XeTeXcountglyphs\testfont
\noindent{\title \myfontname\ contains \number\ng\ glyphs}
\nobreak\medskip
\step=\ng \divide\step by 25
\noindent
  \loop \advance\g by \step
    \ifnum\g<\ng {\testfont\XeTeXglyph\g} \repeat

\end