1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
if not modules then modules = { } end modules ['scrp-tib'] = {
version = 1.001,
comment = "companion to scrp-ini.mkiv",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
license = "see context related readme files"
}
local nuts = nodes.nuts
local getnext = nuts.getnext
local getattr = nuts.getattr
local ischar = nuts.ischar
local getscriptstatus = scripts.getstatus
local inserters = scripts.inserters
local colors = scripts.colors
local injectors = {
breaking_tsheg = inserters.space_after
}
colors.breaking_tsheg = "trace:1"
colors.nonbreaking_tsheg = "trace:2"
local function process(head,first,last)
if first ~= last then
local current = first
while current do
local char, id = ischar(current)
if char then
local category = getscriptstatus(current)
if category then
local injector = injectors[category]
if injector then
head, current = injector(head,current)
end
end
end
if current == last then
break
else
current = getnext(current)
end
end
end
end
scripts.installmethod {
name = "tibetan",
injector = process,
datasets = {
default = {
inter_character_space_factor = 1,
inter_character_stretch_factor = 1,
inter_character_shrink_factor = 1,
},
half = {
inter_character_space_factor = 0.5,
inter_character_stretch_factor = 0.5,
inter_character_shrink_factor = 0.5,
},
quarter = {
inter_character_space_factor = 0.25,
inter_character_stretch_factor = 0.25,
inter_character_shrink_factor = 0.25,
},
},
}
|