summaryrefslogtreecommitdiff
path: root/tests/pln-aux-1.tex
diff options
context:
space:
mode:
authorElie Roux <elie.roux@telecom-bretagne.eu>2013-05-03 01:31:57 -0700
committerElie Roux <elie.roux@telecom-bretagne.eu>2013-05-03 01:31:57 -0700
commit3e3dcf4b43fb6bf14bba1bd4024b418124822e93 (patch)
treeb70a6b21034ce00c7b741329f4b5b50a29ef9e26 /tests/pln-aux-1.tex
parent49cc81c4edff6e3c813a93964923bdb35f07e95c (diff)
parent225c63363a259867bad8848e9e9880e43cbf4ad5 (diff)
downloadluaotfload-3e3dcf4b43fb6bf14bba1bd4024b418124822e93.tar.gz
Merge pull request #14 from lualatex/master
update with lualatex master
Diffstat (limited to 'tests/pln-aux-1.tex')
-rw-r--r--tests/pln-aux-1.tex49
1 files changed, 49 insertions, 0 deletions
diff --git a/tests/pln-aux-1.tex b/tests/pln-aux-1.tex
new file mode 100644
index 0000000..a504850
--- /dev/null
+++ b/tests/pln-aux-1.tex
@@ -0,0 +1,49 @@
+\input luaotfload.sty
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% usage for glyph tests
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\baselineskip=17.28pt
+
+\font\iwonaregular=name:iwona at 14.4pt
+\font\lmromanten=file:lmroman10-regular.otf at 14.4pt
+\font\cmuregular=file:cmunrm.otf at 14.4pt
+
+%% wrap tests in macros (could move to style file)
+\def\doifglyphelse#1#2#3{%
+ \directlua{
+ luaotfload.aux.do_if_glyph_else([[#1]], [[#2]], [[#3]])
+ }%
+}
+
+\def\doifglyph#1#2{\doifglyphelse{#1}{#2}{}}
+
+%% no otf font loaded yet, so both fail:
+first:
+\doifglyphelse{a}{true}{false}
+\doifglyph {a}{yep}
+
+%% load lm and try repeat:
+\lmromanten
+second:
+\doifglyphelse{a}{true}{false}
+\doifglyph {a}{yep}
+
+%% let’s test some more free fonts
+\def\checkglyphset{%
+ \doifglyphelse ö{ö}{nope}
+ \doifglyphelse п{п}{nope}
+ \doifglyphelse α{α}{nope}
+ \doifglyphelse Æ{Æ}{nope}
+ \doifglyphelse ą{ą}{nope}
+ \doifglyphelse ř{ř}{nope}
+ \doifglyphelse ˝{˝}{nope}
+ \doifglyphelse ѩ{ѩ}{nope}
+ \endgraf
+}
+
+\iwonaregular \checkglyphset
+\lmromanten \checkglyphset
+\cmuregular \checkglyphset
+
+\bye