1if not modules then modules = { } end modules [ ' font-lig ' ] = {
2 version = 1 . 001 ,
3 comment = " companion to font-ini.mkiv " ,
4 author = " Hans Hagen, PRAGMA-ADE, Hasselt NL " ,
5 copyright = " PRAGMA ADE / ConTeXt Development Team " ,
6 license = " see context related readme files " ,
7}
8
9
10
11
12local next = next
13
14local standalone = not characters
15
16if standalone then
17 require ( " char-utf " )
18end
19
20local data = { }
21
22for first , seconds in next , characters . graphemes do
23 for second , combined in next , seconds do
24 data [ combined ] = { first , second }
25 end
26end
27
28
29
30
31local feature = {
32 name = " collapse " ,
33 type = " ligature " ,
34 prepend = true ,
35 dataset = {
36 { data = data } ,
37 { data = data } ,
38 }
39}
40
41if standalone then
42 local filename = " luatex-fonts-lig.lua "
43 local filedata = " -- this file is generated by context\n\n "
44 . . " fonts.handlers.otf.addfeature "
45 . . table . serialize ( feature , false )
46 logs . report ( " fonts " , " pseudo ligature file %a saved " , filename )
47 io . savedata ( filename , filedata )
48else
49 fonts . handlers . otf . addfeature ( feature )
50end
51 |