| 1 |
%%% aat-info.tex %%% |
| 2 |
% By Jonathan Kew |
| 3 |
% |
| 4 |
% Prints XeTeX font features for a font |
| 5 |
% using the "AAT" renderer of XeTeX; |
| 6 |
% requires Mac OS X. |
| 7 |
% |
| 8 |
% See 'opentype-info.tex' for the equivalent |
| 9 |
% functionality with OpenType fonts. |
| 10 |
% |
| 11 |
% Usage: |
| 12 |
% Type the name of the font below and compile this |
| 13 |
% document with plain `xetex` to receive a listing |
| 14 |
% of the AAT font features supported by the chosen font. |
| 15 |
% |
| 16 |
% AAT-info is distributed under the Apache License v2: |
| 17 |
% <http://www.apache.org/licenses/LICENSE-2.0.html> |
| 18 |
% |
| 19 |
%%%%%%%%%%%%%%%%%%%% |
| 20 |
% |
| 21 |
% Select the font name: |
| 22 |
\def\myfontname{Hoefler Text} |
| 23 |
% |
| 24 |
%%% AAT-info.tex %%% |
| 25 |
|
| 26 |
|
| 27 |
\font\testfont="\myfontname/AAT" at 10pt |
| 28 |
\nopagenumbers |
| 29 |
|
| 30 |
\baselineskip=14pt |
| 31 |
\font\tenrm="Lucida Grande" at 10pt \tenrm |
| 32 |
\font\title="Lucida Grande Bold" at 12pt |
| 33 |
|
| 34 |
\font\sym="Apple Symbols" at 11pt |
| 35 |
\def\radioOff{{\sym ^^^^25cb}} |
| 36 |
\def\radioOn{{\sym ^^^^25c9}} |
| 37 |
\def\checkOff{{\sym ^^^^2610}} |
| 38 |
\def\checkOn{{\sym ^^^^2612}} |
| 39 |
|
| 40 |
\newcount\nf |
| 41 |
\newcount\f \newcount\fc |
| 42 |
\newcount\ns |
| 43 |
\newcount\s \newcount\sc |
| 44 |
\nf=\XeTeXcountfeatures\testfont |
| 45 |
\noindent {\title AAT features in ‘\myfontname’}\nobreak\medskip |
| 46 |
\ifnum\nf>0 |
| 47 |
\loop |
| 48 |
\fc=\XeTeXfeaturecode\testfont\f |
| 49 |
\noindent \XeTeXfeaturename\testfont\fc\ [\number\fc] |
| 50 |
\endgraf |
| 51 |
\ns=\XeTeXcountselectors\testfont\fc |
| 52 |
{ |
| 53 |
\loop |
| 54 |
\sc=\XeTeXselectorcode\testfont\fc\s |
| 55 |
\textindent{% |
| 56 |
\ifnum\XeTeXisexclusivefeature\testfont\fc>0 |
| 57 |
\ifnum\XeTeXisdefaultselector\testfont\fc\sc>0 \radioOn \else \radioOff \fi |
| 58 |
\else |
| 59 |
\ifnum\XeTeXisdefaultselector\testfont\fc\sc>0 \checkOn \else \checkOff \fi |
| 60 |
\fi |
| 61 |
}\XeTeXselectorname\testfont\fc\sc\ [\number\sc] |
| 62 |
\endgraf |
| 63 |
\advance\s by 1 \ifnum\s<\ns \repeat |
| 64 |
} |
| 65 |
\smallskip |
| 66 |
\advance\f by 1 \ifnum\f<\nf \repeat |
| 67 |
\else |
| 68 |
\noindent {No AAT features available}\par |
| 69 |
\fi |
| 70 |
|
| 71 |
\bigskip |
| 72 |
|
| 73 |
\newcount\val |
| 74 |
\def\appendint{\count255=\val \divide\count255 by 65536 |
| 75 |
\edef\decval{\decval\number\count255}\multiply\count255 by 65536 |
| 76 |
\advance\val by -\count255 } |
| 77 |
\def\decimalize#1{\val=#1 \def\decval{}\appendint \edef\decval{\decval.}% |
| 78 |
\multiply\val by 10 \appendint \multiply\val by 10 \appendint |
| 79 |
\multiply\val by 10 \appendint \multiply\val by 10 \appendint |
| 80 |
\multiply\val by 10 \appendint \multiply\val by 10 \appendint} |
| 81 |
\def\decnum{\afterassignment\printdec \count255=} |
| 82 |
\def\printdec{\dimen255=\count255 sp \expandafter\noPT\the\dimen255 } |
| 83 |
{\catcode`\p=12 \catcode`\t=12 \gdef\noPT#1pt{#1}} |
| 84 |
\newcount\nv |
| 85 |
\newcount\v \newcount\vc |
| 86 |
\nv=\XeTeXcountvariations\testfont |
| 87 |
\noindent {\title AAT variation axes in \myfontname:}\nobreak\medskip |
| 88 |
\ifnum\nv>0 |
| 89 |
\loop |
| 90 |
\vc=\XeTeXvariation\testfont\v |
| 91 |
\noindent \XeTeXvariationname\testfont\vc |
| 92 |
\endgraf |
| 93 |
\indent Range:\ |
| 94 |
{\decimalize{\XeTeXvariationmin\testfont\vc}% |
| 95 |
\font\x="\myfontname:\XeTeXvariationname\testfont\vc=\decval" at 10pt |
| 96 |
\x min \decnum\XeTeXvariationmin\testfont\vc}% |
| 97 |
\ …\ |
| 98 |
{\decimalize{\XeTeXvariationmax\testfont\vc}% |
| 99 |
\font\x="\myfontname:\XeTeXvariationname\testfont\vc=\decval" at 10pt |
| 100 |
\x max \decnum\XeTeXvariationmax\testfont\vc}% |
| 101 |
\ \ |
| 102 |
{\font\x="\myfontname" at 10pt |
| 103 |
\x (default:\ \decnum\XeTeXvariationdefault\testfont\vc)}% |
| 104 |
\endgraf |
| 105 |
\smallskip |
| 106 |
\advance\v by 1 \ifnum\v<\nv \repeat |
| 107 |
\else |
| 108 |
\noindent {No AAT variations available}\par |
| 109 |
\fi |
| 110 |
|
| 111 |
\bigskip |
| 112 |
|
| 113 |
\newcount\ng |
| 114 |
\newcount\g \newcount\step |
| 115 |
\ng=\XeTeXcountglyphs\testfont |
| 116 |
\noindent{\title \myfontname\ contains \number\ng\ glyphs} |
| 117 |
\nobreak\medskip |
| 118 |
\step=\ng \divide\step by 25 |
| 119 |
\noindent |
| 120 |
\loop \advance\g by \step |
| 121 |
\ifnum\g<\ng {\testfont\XeTeXglyph\g} \repeat |
| 122 |
|
| 123 |
\end |