From 4466687a3a53e7868bd157ed6f8eac637ea182b5 Mon Sep 17 00:00:00 2001
From: Philipp Gesang <phg42.2a@gmail.com>
Date: Wed, 1 May 2013 15:41:49 +0200
Subject: draft for new auxlib

---
 tests/pln-aux-1.tex | 45 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 45 insertions(+)
 create mode 100644 tests/pln-aux-1.tex

(limited to 'tests/pln-aux-1.tex')

diff --git a/tests/pln-aux-1.tex b/tests/pln-aux-1.tex
new file mode 100644
index 0000000..f33ef21
--- /dev/null
+++ b/tests/pln-aux-1.tex
@@ -0,0 +1,45 @@
+\input luaotfload.sty
+\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
-- 
cgit v1.2.3


From 7cf60286cb69e8b5ffc47c06bdc9a18bb941e306 Mon Sep 17 00:00:00 2001
From: Philipp Gesang <phg42.2a@gmail.com>
Date: Wed, 1 May 2013 18:34:44 +0200
Subject: add feature related functionality to auxlib

---
 tests/pln-aux-1.tex | 4 ++++
 1 file changed, 4 insertions(+)

(limited to 'tests/pln-aux-1.tex')

diff --git a/tests/pln-aux-1.tex b/tests/pln-aux-1.tex
index f33ef21..a504850 100644
--- a/tests/pln-aux-1.tex
+++ b/tests/pln-aux-1.tex
@@ -1,4 +1,8 @@
 \input luaotfload.sty
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% usage for glyph tests
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \baselineskip=17.28pt
 
 \font\iwonaregular=name:iwona at 14.4pt
-- 
cgit v1.2.3

