| 1 |
%%% opentype-info.tex %%% |
| 2 |
% By Jonathan Kew |
| 3 |
% |
| 4 |
% Prints XeTeX font features for an OpenType |
| 5 |
% font using the "ICU" renderer of XeTeX. |
| 6 |
% |
| 7 |
% See 'aat-info.tex' for the equivalent |
| 8 |
% functionality with AAT fonts (Mac OS X only). |
| 9 |
% |
| 10 |
% Usage: |
| 11 |
% Type the name of the font below and compile this |
| 12 |
% document with plain `xetex` to receive a listing |
| 13 |
% of the OpenType font features, languages & scripts |
| 14 |
% supported by the chosen font. |
| 15 |
% |
| 16 |
% opentype-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{Latin Modern Roman} |
| 23 |
% |
| 24 |
%%% OpenType-info.tex %%% |
| 25 |
|
| 26 |
\font\testfont="\myfontname/ICU" at 12pt |
| 27 |
|
| 28 |
\nopagenumbers |
| 29 |
\rightskip=0pt plus 1fil |
| 30 |
|
| 31 |
\font\title=ec-lmssbx10 at 14pt |
| 32 |
\font\tenrm=ec-lmss10 at 10pt \tenrm |
| 33 |
\font\tentt=ec-lmtt10 at 10pt |
| 34 |
|
| 35 |
\def\fourcharcode#1{\begingroup |
| 36 |
\count0=#1\count1=\count0 |
| 37 |
\ifnum\count0=0 |
| 38 |
$\langle$default$\rangle$% |
| 39 |
\else |
| 40 |
\tentt |
| 41 |
'% |
| 42 |
\divide\count0 by "1000000 |
| 43 |
\char\count0 |
| 44 |
\multiply\count0 by "1000000 |
| 45 |
\advance\count1 by -\count0 |
| 46 |
\count0=\count1 |
| 47 |
\divide\count0 by "10000 |
| 48 |
\char\count0 |
| 49 |
\multiply\count0 by "10000 |
| 50 |
\advance\count1 by -\count0 |
| 51 |
\count0=\count1 |
| 52 |
\divide\count0 by "100 |
| 53 |
\char\count0 |
| 54 |
\multiply\count0 by "100 |
| 55 |
\advance\count1 by -\count0 |
| 56 |
\ifnum\count1=32 \ \else \char\count1 \fi |
| 57 |
'% |
| 58 |
\fi |
| 59 |
\endgroup |
| 60 |
} |
| 61 |
|
| 62 |
\newcount\scriptcount |
| 63 |
\newcount\scriptindex |
| 64 |
\newcount\scripttag |
| 65 |
\newcount\langcount |
| 66 |
\newcount\langindex |
| 67 |
\newcount\langtag |
| 68 |
\newcount\featurecount |
| 69 |
\newcount\featureindex |
| 70 |
\newcount\featuretag |
| 71 |
|
| 72 |
\leftline{\title OpenType Layout features found in `\myfontname'} |
| 73 |
\nobreak\bigskip |
| 74 |
|
| 75 |
\scriptcount=\XeTeXOTcountscripts\testfont |
| 76 |
\ifnum\scriptcount=0 \noindent None\par\fi |
| 77 |
|
| 78 |
\loop |
| 79 |
\ifnum\scriptindex<\scriptcount |
| 80 |
\scripttag=\XeTeXOTscripttag\testfont\scriptindex |
| 81 |
\noindent script = \fourcharcode{\scripttag}\endgraf\nobreak |
| 82 |
\langcount=\XeTeXOTcountlanguages\testfont\scripttag |
| 83 |
\advance\langcount by 1 % one extra to get the default language system |
| 84 |
{\loop |
| 85 |
\langtag=\XeTeXOTlanguagetag\testfont\scripttag\langindex |
| 86 |
\indent language = \fourcharcode{\langtag}\endgraf\nobreak |
| 87 |
\featurecount=\XeTeXOTcountfeatures\testfont\scripttag\langtag |
| 88 |
{\indent\indent \hangindent=3\parindent \hangafter=1 features = \loop |
| 89 |
\featuretag=\XeTeXOTfeaturetag\testfont\scripttag\langtag\featureindex |
| 90 |
\fourcharcode{\featuretag} |
| 91 |
\advance\featureindex by 1 |
| 92 |
\ifnum\featureindex<\featurecount \repeat\endgraf} |
| 93 |
\advance\langindex by 1 |
| 94 |
\ifnum\langindex<\langcount \medskip \repeat} |
| 95 |
\advance\scriptindex by 1 |
| 96 |
\bigskip \repeat |
| 97 |
|
| 98 |
\bye |