summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2008-06-19 00:07:51 +0000
committerKarl Berry <karl@freefriends.org>2008-06-19 00:07:51 +0000
commit89bae23c0f3eecdab79cf863ed1af87a05441a12 (patch)
tree69e58c6180bb02b2786025bd5853fa0dd33c2416 /Master/texmf-dist/tex
parent1df51b7e7e4ab51cc9567313e580188d179b6e43 (diff)
new xetexfontinfo (18jun08)
git-svn-id: svn://tug.org/texlive/trunk@8859 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r--Master/texmf-dist/tex/xetex/xetexfontinfo/AAT-info.tex123
-rw-r--r--Master/texmf-dist/tex/xetex/xetexfontinfo/OpenType-info.tex93
2 files changed, 216 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/xetex/xetexfontinfo/AAT-info.tex b/Master/texmf-dist/tex/xetex/xetexfontinfo/AAT-info.tex
new file mode 100644
index 00000000000..e0ae839348e
--- /dev/null
+++ b/Master/texmf-dist/tex/xetex/xetexfontinfo/AAT-info.tex
@@ -0,0 +1,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
diff --git a/Master/texmf-dist/tex/xetex/xetexfontinfo/OpenType-info.tex b/Master/texmf-dist/tex/xetex/xetexfontinfo/OpenType-info.tex
new file mode 100644
index 00000000000..8aea6e4d992
--- /dev/null
+++ b/Master/texmf-dist/tex/xetex/xetexfontinfo/OpenType-info.tex
@@ -0,0 +1,93 @@
+%%% OpenType-info.tex %%%
+% By Jonathan Kew
+%
+% Prints XeTeX font features for an
+% OpenType font using the "ICU" renderer of XeTeX.
+%
+% 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 %%%
+
+
+\nopagenumbers \rightskip=0pt plus 1fil
+\font\testfont="\myfontname" at 12pt
+\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