[latex3-commits] [git/LaTeX3-latex3-luaotfload] dev: Fixes and tests for falback=..., multiscript=auto (9b9efe0)

Marcel Fabian Krüger tex at 2krueger.de
Sat Dec 21 22:11:10 CET 2019


Repository : https://github.com/latex3/luaotfload
On branch  : dev
Link       : https://github.com/latex3/luaotfload/commit/9b9efe011b5078d2c8c5b2a4121f2c6c304ed5f9

>---------------------------------------------------------------

commit 9b9efe011b5078d2c8c5b2a4121f2c6c304ed5f9
Author: Marcel Fabian Krüger <tex at 2krueger.de>
Date:   Sat Dec 21 22:11:10 2019 +0100

    Fixes and tests for falback=...,multiscript=auto


>---------------------------------------------------------------

9b9efe011b5078d2c8c5b2a4121f2c6c304ed5f9
 src/luaotfload-multiscript.lua |  6 ++--
 testfiles-harf/fallback.lvt    | 30 +++++++++++++++++
 testfiles-harf/fallback.tlg    | 75 ++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 108 insertions(+), 3 deletions(-)

diff --git a/src/luaotfload-multiscript.lua b/src/luaotfload-multiscript.lua
index 6ba6a2f..2137224 100644
--- a/src/luaotfload-multiscript.lua
+++ b/src/luaotfload-multiscript.lua
@@ -213,7 +213,7 @@ local function makecombifont(tfmdata, _, additional_scripts)
             scr_fb = {}
             fallbacks[script] = scr_fb
           end
-          scr_fb[#scr_fb + 1] = current.specification.specification
+          scr_fb[#scr_fb + 1] = current.specification.specification .. ';script=' .. script .. ';-multiscript'
         end
         i = i - 1
         current = fallback[i]
@@ -224,7 +224,7 @@ local function makecombifont(tfmdata, _, additional_scripts)
         local collected = collect_scripts(current)
         for script, scr_fb in next, fallbacks do
           if not collected[script] then
-            scr_fb[#scr_fb + 1] = current.specification.specification
+            scr_fb[#scr_fb + 1] = current.specification.specification .. ';-multiscript'
           end
         end
         i = i - 1
@@ -236,7 +236,7 @@ local function makecombifont(tfmdata, _, additional_scripts)
           local main = scr_fb[1]
           table.remove(scr_fb, 1)
           local fbid = luaotfload.add_fallback(scr_fb)
-          additional_scripts[iso_script] = main .. ';-multiscript;script=' .. script .. ';fallback=' .. fbid
+          additional_scripts[iso_script] = main .. ';fallback=' .. fbid
         end
       end
     else
diff --git a/testfiles-harf/fallback.lvt b/testfiles-harf/fallback.lvt
new file mode 100644
index 0000000..e021982
--- /dev/null
+++ b/testfiles-harf/fallback.lvt
@@ -0,0 +1,30 @@
+\input regression-test.tex\relax
+
+\documentclass{article}
+
+\directlua{
+  local cbs = luatexbase.callback_descriptions'glyph_info'
+  local desc = cbs[1]
+  assert(desc == "Harf glyph_info callback" and nil == next(cbs, 1))
+  local cb = luatexbase.remove_from_callback('glyph_info', desc)
+  luatexbase.add_to_callback('glyph_info', function(n)
+  return string.format('"\csstring\%s" \csstring\%04X \csstring\%+i:\csstring\%+i\string\t\csstring\%s', cb(n), n.char, n.xoffset, n.yoffset, font.getfont(n.font).specification.specification)
+  end, 'Harf glyph_info callback -- testing variant')
+}
+
+\directlua{luaotfload.add_fallback("myfallback", {
+    "Noto Color Emoji:mode=harf","[DejaVuSans.ttf]:mode=harf","Siddhanta:mode=harf","Noto Serif Tibetan:mode=node"
+  })}
+
+\begin{document}
+\showoutput
+\START
+\font\fonts"Noto Serif:mode=harf,multiscript=auto,fallback=myfallback"
+\fonts
+᚛ᚓᚅᚐᚁᚐᚏᚏ᚜ རྐྱກົ້ฐูà́̂̃कि Text 😺 emoji 
+
+\newpage
+\directlua{
+  texio.write_nl(status.node_mem_usage)
+}
+\end{document}
diff --git a/testfiles-harf/fallback.tlg b/testfiles-harf/fallback.tlg
new file mode 100644
index 0000000..d0f2521
--- /dev/null
+++ b/testfiles-harf/fallback.tlg
@@ -0,0 +1,75 @@
+This is a generated file for the l3build validation system.
+Don't change this file in any respect.
+luaotfload | cache : Lookup cache loaded from /home/marcel/.texlive2019/texmf-var/luatex-cache/generic-dev/names/luaotfload-lookup-cache.luc.
+Completed box being shipped out [1]
+\vbox(633.0+0.0)x407.0, direction TLT
+.\glue 16.0
+.\vbox(617.0+0.0)x345.0, shifted 62.0, direction TLT
+..\vbox(12.0+0.0)x345.0, glue set 12.0fil, direction TLT
+...\glue 0.0 plus 1.0fil
+...\hbox(0.0+0.0)x345.0, direction TLT
+..\glue 25.0
+..\glue(\lineskip) 0.0
+..\vbox(550.0+0.0)x345.0, glue set 535.70282fil, direction TLT
+...\write-{}
+...\glue(\topskip) 0.0
+...\hbox(14.23999+3.89)x345.0, glue set 142.14958fil, direction TLT
+....\localpar
+.....\localinterlinepenalty=0
+.....\localbrokenpenalty=0
+.....\localleftbox=null
+.....\localrightbox=null
+....\hbox(0.0+0.0)x15.0, direction TLT
+....\FONT35 "᚛" 169B +0:+0^^I[DejaVuSans.ttf]:mode=harf;-fallback;script=ogam;-multiscript;fallback=20
+....\FONT35 "ᚓ" 1693 +0:+0^^I[DejaVuSans.ttf]:mode=harf;-fallback;script=ogam;-multiscript;fallback=20
+....\FONT35 "ᚅ" 1685 +0:+0^^I[DejaVuSans.ttf]:mode=harf;-fallback;script=ogam;-multiscript;fallback=20
+....\FONT35 "ᚐ" 1690 +0:+0^^I[DejaVuSans.ttf]:mode=harf;-fallback;script=ogam;-multiscript;fallback=20
+....\FONT35 "ᚁ" 1681 +0:+0^^I[DejaVuSans.ttf]:mode=harf;-fallback;script=ogam;-multiscript;fallback=20
+....\FONT35 "ᚐ" 1690 +0:+0^^I[DejaVuSans.ttf]:mode=harf;-fallback;script=ogam;-multiscript;fallback=20
+....\FONT35 "ᚏ" 168F +0:+0^^I[DejaVuSans.ttf]:mode=harf;-fallback;script=ogam;-multiscript;fallback=20
+....\FONT35 "ᚏ" 168F +0:+0^^I[DejaVuSans.ttf]:mode=harf;-fallback;script=ogam;-multiscript;fallback=20
+....\FONT35 "᚜" 169C +0:+0^^I[DejaVuSans.ttf]:mode=harf;-fallback;script=ogam;-multiscript;fallback=20
+....\glue(\spaceskip) 2.6 plus 1.3 minus 0.86667
+....\FONT37 "󰌔" F0314 +0:+0^^INoto Serif Tibetan:mode=node;-fallback;script=tibt;-multiscript;fallback=11 (ligature "ར" 0F62 +0:+0^^INoto Serif Tibetan:mode=node;-fallback;script=tibt;-multiscript;fallback=11"ྐ" 0F90 +0:+0^^INoto Serif Tibetan:mode=node;-fallback;script=tibt;-multiscript;fallback=11"ྱ" 0FB1 +0:+0^^INoto Serif Tibetan:mode=node;-fallback;script=tibt;-multiscript;fallback=11)
+....\FONT38 "ກ" 0E81 +0:+0^^I[DejaVuSans.ttf]:mode=harf;-fallback;script=lao;-multiscript;fallback=18
+....\FONT38 "ົ" 0EBB +0:-2880^^I[DejaVuSans.ttf]:mode=harf;-fallback;script=lao;-multiscript;fallback=18
+....\FONT38 "້" 0EC9 +0:-6080^^I[DejaVuSans.ttf]:mode=harf;-fallback;script=lao;-multiscript;fallback=18
+....\FONT39 "ฐ" 120000 +0:+0^^I[DejaVuSans.ttf]:mode=harf;-fallback;script=thai;-multiscript;fallback=10
+....\pdfliteral page <lua data reference ...>
+....\FONT39 "ู" 120000 +0:+0^^I[DejaVuSans.ttf]:mode=harf;-fallback;script=thai;-multiscript;fallback=10
+....\pdfliteral page <lua data reference ...>
+....\FONT43 "à" 00E0 +0:+0^^INoto Serif:mode=harf,multiscript=auto,fallback=myfallback;script=latn;-multiscript;fallback=22
+....\FONT43 "́" 0301 -23593:+150733^^INoto Serif:mode=harf,multiscript=auto,fallback=myfallback;script=latn;-multiscript;fallback=22
+....\FONT43 "̂" 0302 +5898:+301466^^INoto Serif:mode=harf,multiscript=auto,fallback=myfallback;script=latn;-multiscript;fallback=22
+....\FONT43 "̃" 0303 +24248:+452198^^INoto Serif:mode=harf,multiscript=auto,fallback=myfallback;script=latn;-multiscript;fallback=22
+....\pdfliteral page <lua data reference ...>
+....\FONT44 "कि" F311 +0:+0^^ISiddhanta:mode=harf;-fallback;script=deva;-multiscript;fallback=12
+....\FONT44 "" 0915 +0:+0^^ISiddhanta:mode=harf;-fallback;script=deva;-multiscript;fallback=12
+....\pdfliteral page <lua data reference ...>
+....\glue(\spaceskip) 2.6 plus 1.3 minus 0.86667
+....\FONT43 "T" 0054 +0:+0^^INoto Serif:mode=harf,multiscript=auto,fallback=myfallback;script=latn;-multiscript;fallback=22
+....\kern-0.5 (font)
+....\FONT43 "e" 0065 +0:+0^^INoto Serif:mode=harf,multiscript=auto,fallback=myfallback;script=latn;-multiscript;fallback=22
+....\FONT43 "x" 0078 +0:+0^^INoto Serif:mode=harf,multiscript=auto,fallback=myfallback;script=latn;-multiscript;fallback=22
+....\FONT43 "t" 0074 +0:+0^^INoto Serif:mode=harf,multiscript=auto,fallback=myfallback;script=latn;-multiscript;fallback=22
+....\glue(\spaceskip) 2.6 plus 1.3 minus 0.86667
+....\FONT42 "😺" 1F63A +0:+0^^I[DejaVuSans.ttf]:mode=harf;-fallback;script=latn;-multiscript;-fallback
+....\glue(\spaceskip) 2.6 plus 1.3 minus 0.86667
+....\FONT43 "e" 0065 +0:+0^^INoto Serif:mode=harf,multiscript=auto,fallback=myfallback;script=latn;-multiscript;fallback=22
+....\FONT43 "m" 006D +0:+0^^INoto Serif:mode=harf,multiscript=auto,fallback=myfallback;script=latn;-multiscript;fallback=22
+....\FONT43 "o" 006F +0:+0^^INoto Serif:mode=harf,multiscript=auto,fallback=myfallback;script=latn;-multiscript;fallback=22
+....\FONT43 "j" 006A +0:+0^^INoto Serif:mode=harf,multiscript=auto,fallback=myfallback;script=latn;-multiscript;fallback=22
+....\FONT43 "i" 0069 +0:+0^^INoto Serif:mode=harf,multiscript=auto,fallback=myfallback;script=latn;-multiscript;fallback=22
+....\penalty 10000
+....\glue(\parfillskip) 0.0 plus 1.0fil
+....\glue(\rightskip) 0.0
+...\glue -3.89
+...\glue 0.0 plus 1.0fil
+...\glue 0.0
+...\glue 0.0 plus 0.0001fil
+..\glue(\baselineskip) 23.34
+..\hbox(6.66+0.0)x345.0, glue set 170.0fil, direction TLT
+...\glue 0.0 plus 1.0fil
+...\TU/lmr/m/n/10 "1" 0031 +0:+0^^I[lmroman10-regular]:+tlig;
+...\glue 0.0 plus 1.0fil
+2 hlist, 1 rule, 1 dir, 3 kern, 1 glyph, 2 attribute, 48 glue_spec, 2 attribute_list (fallback.aux)





More information about the latex3-commits mailing list