1if not modules then modules = { } end modules ['math-ext'] = {
2 version = 1.001,
3 comment = "companion to math-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
12
13
14
15
16
17
18local getproperty = nodes.getproperty
19
20local extensibles = { }
21
22function mathematics.registerextensible(specification)
23 local unicode = specification.unicode
24 if unicode then
25 extensibles[unicode] = specification
26 end
27end
28
29
30
31
32
33
34
35
36function mathematics.setextensibledata(data)
37 context(nodes.upcomingproperties { extensible = data })
38end
39
40function mathematics.getextensibledata(target)
41 local property = getproperty(target)
42 return property and property.extensible
43end
44
45callback.register("make_extensible",function(target,fnt,chr,size,width,height,depth,linewidth,axis,exheight,emwidth)
46 local found = extensibles[chr]
47 if found then
48 local action = found.action
49 if action then
50 return action(target,fnt,chr,size,width,height,depth,linewidth,axis,exheight,emwidth)
51 end
52 end
53end)
54
55if not nodes.setattrlist then
56
57 local tonut = nodes.tonut
58 local setattrlist = nodes.nuts.setattrlist
59
60 function nodes.setattrlist(target,source)
61 setattrlist(tonut(target),tonut(source))
62 end
63
64end
65 |