scrp-tib.lua /size: 2026 b    last modification: 2020-07-01 14:35
1
if
not
modules
then
modules
=
{
}
end
modules
[
'
scrp-tib
'
]
=
{
2
version
=
1
.
001
,
3
comment
=
"
companion to scrp-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
nuts
=
nodes
.
nuts
10 11
local
getnext
=
nuts
.
getnext
12
local
getattr
=
nuts
.
getattr
13
local
ischar
=
nuts
.
ischar
14 15
local
getscriptstatus
=
scripts
.
getstatus
16 17
local
inserters
=
scripts
.
inserters
18
local
colors
=
scripts
.
colors
19 20
local
injectors
=
{
21
breaking_tsheg
=
inserters
.
space_after
22
}
23 24
colors
.
breaking_tsheg
=
"
trace:1
"
25
colors
.
nonbreaking_tsheg
=
"
trace:2
"
26 27
local
function
process
(
head
,
first
,
last
)
28
if
first
~
=
last
then
29
local
current
=
first
30
while
current
do
31
local
char
,
id
=
ischar
(
current
)
32
if
char
then
33
local
category
=
getscriptstatus
(
current
)
34
if
category
then
35
local
injector
=
injectors
[
category
]
36
if
injector
then
37
head
,
current
=
injector
(
head
,
current
)
38
end
39
end
40
end
41
if
current
=
=
last
then
42
break
43
else
44
current
=
getnext
(
current
)
45
end
46
end
47
end
48
end
49 50
scripts
.
installmethod
{
51
name
=
"
tibetan
"
,
52
injector
=
process
,
53
datasets
=
{
54
default
=
{
55
inter_character_space_factor
=
1
,
56
inter_character_stretch_factor
=
1
,
57
inter_character_shrink_factor
=
1
,
58
}
,
59
half
=
{
60
inter_character_space_factor
=
0
.
5
,
61
inter_character_stretch_factor
=
0
.
5
,
62
inter_character_shrink_factor
=
0
.
5
,
63
}
,
64
quarter
=
{
65
inter_character_space_factor
=
0
.
25
,
66
inter_character_stretch_factor
=
0
.
25
,
67
inter_character_shrink_factor
=
0
.
25
,
68
}
,
69
}
,
70
}
71