blob: c91b54f7a486a735f56cf99d4e937dc0d08030dc (
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
|
%%% opentype-info.tex %%%
% By Jonathan Kew
%
% Prints XeTeX font features for an OpenType
% font using the "ICU" renderer of XeTeX.
%
% See 'aat-info.tex' for the equivalent
% functionality with AAT fonts (Mac OS X only).
%
% Usage:
% Type the name of the font below and compile this
% document with plain `xetex` to receive a listing
% of the OpenType font features, languages & scripts
% supported by the chosen font.
%
% opentype-info is distributed under the Apache License v2:
% <http://www.apache.org/licenses/LICENSE-2.0.html>
%
%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Select the font name:
\def\myfontname{Latin Modern Roman}
%
%%% OpenType-info.tex %%%
\font\testfont="\myfontname/ICU" at 12pt
\nopagenumbers
\rightskip=0pt plus 1fil
\font\title=ec-lmssbx10 at 14pt
\font\tenrm=ec-lmss10 at 10pt \tenrm
\font\tentt=ec-lmtt10 at 10pt
\def\fourcharcode#1{\begingroup
\count0=#1\count1=\count0
\ifnum\count0=0
$\langle$default$\rangle$%
\else
\tentt
'%
\divide\count0 by "1000000
\char\count0
\multiply\count0 by "1000000
\advance\count1 by -\count0
\count0=\count1
\divide\count0 by "10000
\char\count0
\multiply\count0 by "10000
\advance\count1 by -\count0
\count0=\count1
\divide\count0 by "100
\char\count0
\multiply\count0 by "100
\advance\count1 by -\count0
\ifnum\count1=32 \ \else \char\count1 \fi
'%
\fi
\endgroup
}
\newcount\scriptcount
\newcount\scriptindex
\newcount\scripttag
\newcount\langcount
\newcount\langindex
\newcount\langtag
\newcount\featurecount
\newcount\featureindex
\newcount\featuretag
\leftline{\title OpenType Layout features found in `\myfontname'}
\nobreak\bigskip
\scriptcount=\XeTeXOTcountscripts\testfont
\ifnum\scriptcount=0 \noindent None\par\fi
\loop
\ifnum\scriptindex<\scriptcount
\scripttag=\XeTeXOTscripttag\testfont\scriptindex
\noindent script = \fourcharcode{\scripttag}\endgraf\nobreak
\langcount=\XeTeXOTcountlanguages\testfont\scripttag
\advance\langcount by 1 % one extra to get the default language system
{\loop
\langtag=\XeTeXOTlanguagetag\testfont\scripttag\langindex
\indent language = \fourcharcode{\langtag}\endgraf\nobreak
\featurecount=\XeTeXOTcountfeatures\testfont\scripttag\langtag
{\indent\indent \hangindent=3\parindent \hangafter=1 features = \loop
\featuretag=\XeTeXOTfeaturetag\testfont\scripttag\langtag\featureindex
\fourcharcode{\featuretag}
\advance\featureindex by 1
\ifnum\featureindex<\featurecount \repeat\endgraf}
\advance\langindex by 1
\ifnum\langindex<\langcount \medskip \repeat}
\advance\scriptindex by 1
\bigskip \repeat
\bye
|