symb-ini.lua /size: 1564 b    last modification: 2020-07-01 14:35
1
if
not
modules
then
modules
=
{
}
end
modules
[
'
symb-ini
'
]
=
{
2
version
=
1
.
001
,
3
comment
=
"
companion to symb-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
local
context
=
context
10
local
variables
=
interfaces
.
variables
11 12
fonts
=
fonts
or
{
}
-- brrrr
13 14
local
symbols
=
fonts
.
symbols
or
{
}
15
fonts
.
symbols
=
symbols
16 17
local
listitem
=
utilities
.
parsers
.
listitem
18
local
uselibrary
=
resolvers
.
uselibrary
19 20
local
report_symbols
=
logs
.
reporter
(
"
fonts
"
,
"
symbols
"
)
21
local
status_symbols
=
logs
.
messenger
(
"
fonts
"
,
"
symbols
"
)
22 23
local
patterns
=
{
24
CONTEXTLMTXMODE
>
0
and
"
symb-imp-%s.mkxl
"
or
"
"
,
25
"
symb-imp-%s.mkiv
"
,
26
"
symb-imp-%s.tex
"
,
27
-- obsolete:
28
"
symb-%s.mkiv
"
,
29
"
symb-%s.tex
"
30
}
31 32
local
function
action
(
name
,
foundname
)
33
commands
.
loadlibrary
(
name
,
foundname
,
false
)
34
status_symbols
(
"
library %a loaded
"
,
name
)
35
end
36 37
local
function
failure
(
name
)
38
report_symbols
(
"
library %a is unknown
"
,
name
)
39
end
40 41
function
symbols
.
uselibrary
(
name
)
42
if
name
~
=
variables
.
reset
then
43
for
name
in
listitem
(
name
)
do
44
uselibrary
{
45
name
=
name
,
46
patterns
=
patterns
,
47
action
=
action
,
48
failure
=
failure
,
49
onlyonce
=
true
,
50
}
51
end
52
end
53
end
54 55
interfaces
.
implement
{
56
name
=
"
usesymbols
"
,
57
actions
=
symbols
.
uselibrary
,
58
arguments
=
"
string
"
,
59
}
60