From e2658addf306f729945c184e46f98df39dd7026c Mon Sep 17 00:00:00 2001
From: Hans Hagen <pragma@wxs.nl>
Date: Wed, 29 May 2019 21:10:47 +0200
Subject: 2019-05-29 19:20:00

---
 .../general/manuals/fonts/fonts-environment.tex    | 74 ++++++++++++++++++++++
 1 file changed, 74 insertions(+)
 create mode 100644 doc/context/sources/general/manuals/fonts/fonts-environment.tex

(limited to 'doc/context/sources/general/manuals/fonts/fonts-environment.tex')

diff --git a/doc/context/sources/general/manuals/fonts/fonts-environment.tex b/doc/context/sources/general/manuals/fonts/fonts-environment.tex
new file mode 100644
index 000000000..c884d97e5
--- /dev/null
+++ b/doc/context/sources/general/manuals/fonts/fonts-environment.tex
@@ -0,0 +1,74 @@
+\startenvironment fonts-environment
+
+    % we need to do this beforehand
+
+    \blockligatures[fi,fl,ff]
+
+    \startbuffer[extraminus]
+    \startluacode
+        fonts.helpers.addextraprivate("smallminus", function(tfmdata)
+            local hchar = tfmdata.characters[0x002D]
+            local mchar = tfmdata.characters[0x2212]
+            if hchar and mchar then
+                return {
+                    width    = hchar.width,
+                    height   = mchar.height,
+                    commands = {
+                        { "down", hchar.height - mchar.height },
+                        { "char", 0x002D },
+                    }
+                }
+            end
+        end)
+        fonts.helpers.addextraprivate("highminus", function(tfmdata)
+            local hchar = tfmdata.characters[0x002D]
+            local mchar = tfmdata.characters[0x2212]
+            local xchar = tfmdata.characters[0x0058]
+            if hchar and mchar and xchar then
+                return {
+                    width    = hchar.width,
+                    height   = mchar.height,
+                    commands = {
+                        { "down", - xchar.height + mchar.height },
+                        { "char", 0x002D },
+                    }
+                }
+            end
+        end)
+    \stopluacode
+    \stopbuffer
+
+    \getbuffer[extraminus]
+
+    % so far for preloading
+
+    \environment manuals-explaining-environment
+    \environment manuals-explaining-cover
+
+    \enabledirectives[visualizers.fraction=2]
+
+    \usemodule [s] [fonts-tables]
+    \usemodule [s] [fonts-missing]
+    \usemodule [s] [fonts-vectors]
+    \usemodule [s] [fonts-features]
+    \usemodule [s] [math-extensibles]
+
+    \definefontfeature[demo-onum][kern=yes,onum=yes]
+    %definefontfeature[demo-lnum][kern=yes,lnum=yes]
+    \definefontfeature[demo-tnum][kern=yes,tnum=yes]
+    \definefontfeature[demo-pnum][kern=yes,pnum=yes]
+    \definefontfeature[demo-zero][zero=yes]
+    \definefontfeature[demo-none][]
+
+    \definefont[DemoOnumLM][file:lmroman10-regular*demo-onum at 42pt]
+    %definefont[DemoLnumLM][file:lmroman10-regular*demo-lnum at 42pt]
+    \definefont[DemoTnumLM][file:lmroman10-regular*demo-tnum at 42pt]
+    \definefont[DemoPnumLM][file:lmroman10-regular*demo-pnum at 42pt]
+
+    \definefont[DemoZeroLM][file:lmroman10-regular*demo-zero at 42pt]
+    \definefont[DemoNoneLM][file:lmroman10-regular*demo-none at 42pt]
+
+    \definefont[DemoZeroLT][file:lmtypewriter10-regular*demo-zero at 42pt]
+    \definefont[DemoNoneLT][file:lmtypewriter10-regular*demo-none at 42pt]
+
+\stopenvironment
-- 
cgit v1.2.3

