summaryrefslogtreecommitdiff
path: root/tex/context/base/font-odv.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2013-10-01 19:00:00 +0200
committerHans Hagen <pragma@wxs.nl>2013-10-01 19:00:00 +0200
commitc54e16cd36f55642657ebe388715b6fd890d13ec (patch)
treed67661ff79193fb8555c1cbc8d533bc91e65fd85 /tex/context/base/font-odv.lua
parent56f25d8a5368c042d5c8ab92205007cb9d5c21b3 (diff)
downloadcontext-c54e16cd36f55642657ebe388715b6fd890d13ec.tar.gz
beta 2013.10.01 19:00
Diffstat (limited to 'tex/context/base/font-odv.lua')
-rw-r--r--tex/context/base/font-odv.lua23
1 files changed, 15 insertions, 8 deletions
diff --git a/tex/context/base/font-odv.lua b/tex/context/base/font-odv.lua
index 7437bd8c3..69f74dfa5 100644
--- a/tex/context/base/font-odv.lua
+++ b/tex/context/base/font-odv.lua
@@ -133,7 +133,12 @@ replace_all_nbsp = function(head) -- delayed definition
end
local fontprocesses = fonts.hashes.processes
-local xprocesscharacters = nodes.handlers.characters
+local xprocesscharacters = nil
+
+xprocesscharacters = function(head,font)
+ xprocesscharacters = nodes.handlers.characters
+ return xprocesscharacters(head,font)
+end
local function processcharacters(head,font)
return xprocesscharacters(head)
@@ -559,7 +564,7 @@ local function deva_reorder(head,start,stop,font,attr,nbspaces)
-- if syllable starts with Ra + H and script has 'Reph' then exclude Reph
-- from candidates for base consonants
if n == stop then
- return head, stop
+ return head, stop, nbspaces
end
if n.next.char == c_zwj then
current = start
@@ -575,7 +580,7 @@ local function deva_reorder(head,start,stop,font,attr,nbspaces)
stop = stop.prev
head = remove_node(head,current)
free_node(current)
- return head, stop
+ return head, stop, nbspaces
else
nbspaces = nbspaces + 1
base = current
@@ -592,7 +597,7 @@ local function deva_reorder(head,start,stop,font,attr,nbspaces)
if next ~= stop and halant[next.char] then
current = next
next = current.next
- local tmp = next.next
+ local tmp = next and next.next or nil -- needs checking
local changestop = next == stop
local tempcurrent = copy_node(next)
local nextcurrent = copy_node(current)
@@ -610,7 +615,9 @@ local function deva_reorder(head,start,stop,font,attr,nbspaces)
current.char = tempcurrent.char -- (assumes that result of blwf consists of one node)
local freenode = current.next
current.next = tmp
- tmp.prev = current
+ if tmp then
+ tmp.prev = current
+ end
free_node(freenode)
flush_list(tempcurrent)
if changestop then
@@ -1390,12 +1397,12 @@ local function dev2_reorder(head,start,stop,font,attr,nbspaces) -- maybe do a pa
current = start.next.next
end
- local function action(is_nbsp)
+ local function stand_alone(is_nbsp)
if current == stop then
stop = stop.prev
head = remove_node(head,current)
free_node(current)
- return head, stop
+ return head, stop, nbspaces
else
if is_nbsp then
nbspaces = nbspaces + 1
@@ -1473,7 +1480,7 @@ local function dev2_reorder(head,start,stop,font,attr,nbspaces) -- maybe do a pa
if start[a_state] == s_rphf then
start[a_state] = unsetvalue
end
- return head, stop
+ return head, stop, nbspaces
else
if base[a_state] then
base[a_state] = unsetvalue