summaryrefslogtreecommitdiff
path: root/tex/context/base/font-otx.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/font-otx.lua')
-rw-r--r--tex/context/base/font-otx.lua93
1 files changed, 46 insertions, 47 deletions
diff --git a/tex/context/base/font-otx.lua b/tex/context/base/font-otx.lua
index b7d2ae0bc..dc0469e39 100644
--- a/tex/context/base/font-otx.lua
+++ b/tex/context/base/font-otx.lua
@@ -37,13 +37,12 @@ local getfield = nuts.getfield
local getnext = nuts.getnext
local getprev = nuts.getprev
local getid = nuts.getid
-local getattr = nuts.getattr
+local getprop = nuts.getprop
+local setprop = nuts.setprop
local getfont = nuts.getfont
local getsubtype = nuts.getsubtype
local getchar = nuts.getchar
-local setattr = nuts.setattr
-
local traverse_id = nuts.traverse_id
local traverse_node_list = nuts.traverse
local end_of_math = nuts.end_of_math
@@ -124,34 +123,34 @@ function analyzers.setstate(head,font) -- we can skip math
if d then
if d.class == "mark" then
done = true
- setattr(current,a_state,s_mark)
+ setprop(current,a_state,s_mark)
elseif useunicodemarks and categories[char] == "mn" then
done = true
- setattr(current,a_state,s_mark)
+ setprop(current,a_state,s_mark)
elseif n == 0 then
first, last, n = current, current, 1
- setattr(current,a_state,s_init)
+ setprop(current,a_state,s_init)
else
last, n = current, n+1
- setattr(current,a_state,s_medi)
+ setprop(current,a_state,s_medi)
end
else -- finish
if first and first == last then
- setattr(last,a_state,s_isol)
+ setprop(last,a_state,s_isol)
elseif last then
- setattr(last,a_state,s_fina)
+ setprop(last,a_state,s_fina)
end
first, last, n = nil, nil, 0
end
elseif id == disc_code then
-- always in the middle
- setattr(current,a_state,s_medi)
+ setprop(current,a_state,s_medi)
last = current
else -- finish
if first and first == last then
- setattr(last,a_state,s_isol)
+ setprop(last,a_state,s_isol)
elseif last then
- setattr(last,a_state,s_fina)
+ setprop(last,a_state,s_fina)
end
first, last, n = nil, nil, 0
if id == math_code then
@@ -161,9 +160,9 @@ function analyzers.setstate(head,font) -- we can skip math
current = getnext(current)
end
if first and first == last then
- setattr(last,a_state,s_isol)
+ setprop(last,a_state,s_isol)
elseif last then
- setattr(last,a_state,s_fina)
+ setprop(last,a_state,s_fina)
end
return head, done
end
@@ -279,92 +278,92 @@ function methods.arab(head,font,attr)
current = tonut(current)
while current do
local id = getid(current)
- if id == glyph_code and getfont(current) == font and getsubtype(current)<256 and not getattr(current,a_state) then
+ if id == glyph_code and getfont(current) == font and getsubtype(current)<256 and not getprop(current,a_state) then
done = true
local char = getchar(current)
local classifier = classifiers[char]
if not classifier then
if last then
if c_last == s_medi or c_last == s_fina then
- setattr(last,a_state,s_fina)
+ setprop(last,a_state,s_fina)
else
warning(last,"fina")
- setattr(last,a_state,s_error)
+ setprop(last,a_state,s_error)
end
first, last = nil, nil
elseif first then
if c_first == s_medi or c_first == s_fina then
- setattr(first,a_state,s_isol)
+ setprop(first,a_state,s_isol)
else
warning(first,"isol")
- setattr(first,a_state,s_error)
+ setprop(first,a_state,s_error)
end
first = nil
end
elseif classifier == s_mark then
- setattr(current,a_state,s_mark)
+ setprop(current,a_state,s_mark)
elseif classifier == s_isol then
if last then
if c_last == s_medi or c_last == s_fina then
- setattr(last,a_state,s_fina)
+ setprop(last,a_state,s_fina)
else
warning(last,"fina")
- setattr(last,a_state,s_error)
+ setprop(last,a_state,s_error)
end
first, last = nil, nil
elseif first then
if c_first == s_medi or c_first == s_fina then
- setattr(first,a_state,s_isol)
+ setprop(first,a_state,s_isol)
else
warning(first,"isol")
- setattr(first,a_state,s_error)
+ setprop(first,a_state,s_error)
end
first = nil
end
- setattr(current,a_state,s_isol)
+ setprop(current,a_state,s_isol)
elseif classifier == s_medi then
if first then
last = current
c_last = classifier
- setattr(current,a_state,s_medi)
+ setprop(current,a_state,s_medi)
else
- setattr(current,a_state,s_init)
+ setprop(current,a_state,s_init)
first = current
c_first = classifier
end
elseif classifier == s_fina then
if last then
- if getattr(last,a_state) ~= s_init then
- setattr(last,a_state,s_medi)
+ if getprop(last,a_state) ~= s_init then
+ setprop(last,a_state,s_medi)
end
- setattr(current,a_state,s_fina)
+ setprop(current,a_state,s_fina)
first, last = nil, nil
elseif first then
- -- if getattr(first,a_state) ~= s_init then
+ -- if getprop(first,a_state) ~= s_init then
-- -- needs checking
- -- setattr(first,a_state,s_medi)
+ -- setprop(first,a_state,s_medi)
-- end
- setattr(current,a_state,s_fina)
+ setprop(current,a_state,s_fina)
first = nil
else
- setattr(current,a_state,s_isol)
+ setprop(current,a_state,s_isol)
end
else -- classifier == s_rest
- setattr(current,a_state,s_rest)
+ setprop(current,a_state,s_rest)
if last then
if c_last == s_medi or c_last == s_fina then
- setattr(last,a_state,s_fina)
+ setprop(last,a_state,s_fina)
else
warning(last,"fina")
- setattr(last,a_state,s_error)
+ setprop(last,a_state,s_error)
end
first, last = nil, nil
elseif first then
if c_first == s_medi or c_first == s_fina then
- setattr(first,a_state,s_isol)
+ setprop(first,a_state,s_isol)
else
warning(first,"isol")
- setattr(first,a_state,s_error)
+ setprop(first,a_state,s_error)
end
first = nil
end
@@ -372,18 +371,18 @@ function methods.arab(head,font,attr)
else
if last then
if c_last == s_medi or c_last == s_fina then
- setattr(last,a_state,s_fina)
+ setprop(last,a_state,s_fina)
else
warning(last,"fina")
- setattr(last,a_state,s_error)
+ setprop(last,a_state,s_error)
end
first, last = nil, nil
elseif first then
if c_first == s_medi or c_first == s_fina then
- setattr(first,a_state,s_isol)
+ setprop(first,a_state,s_isol)
else
warning(first,"isol")
- setattr(first,a_state,s_error)
+ setprop(first,a_state,s_error)
end
first = nil
end
@@ -395,17 +394,17 @@ function methods.arab(head,font,attr)
end
if last then
if c_last == s_medi or c_last == s_fina then
- setattr(last,a_state,s_fina)
+ setprop(last,a_state,s_fina)
else
warning(last,"fina")
- setattr(last,a_state,s_error)
+ setprop(last,a_state,s_error)
end
elseif first then
if c_first == s_medi or c_first == s_fina then
- setattr(first,a_state,s_isol)
+ setprop(first,a_state,s_isol)
else
warning(first,"isol")
- setattr(first,a_state,s_error)
+ setprop(first,a_state,s_error)
end
end
return head, done