diff options
-rw-r--r-- | tex/context/base/cont-new.mkiv | 2 | ||||
-rw-r--r-- | tex/context/base/context-version.pdf | bin | 4113 -> 4106 bytes | |||
-rw-r--r-- | tex/context/base/context.mkiv | 2 | ||||
-rw-r--r-- | tex/context/base/font-odv.lua | 54 | ||||
-rw-r--r-- | tex/context/base/spac-chr.lua | 61 | ||||
-rw-r--r-- | tex/context/base/status-files.pdf | bin | 24754 -> 24756 bytes | |||
-rw-r--r-- | tex/context/base/status-lua.log | 2 | ||||
-rw-r--r-- | tex/generic/context/luatex/luatex-fonts-merged.lua | 2 |
8 files changed, 58 insertions, 65 deletions
diff --git a/tex/context/base/cont-new.mkiv b/tex/context/base/cont-new.mkiv index fec4739ad..f9b31f31b 100644 --- a/tex/context/base/cont-new.mkiv +++ b/tex/context/base/cont-new.mkiv @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2013.09.19 09:20} +\newcontextversion{2013.09.19 13:52} %D This file is loaded at runtime, thereby providing an excellent place for %D hacks, patches, extensions and new features. diff --git a/tex/context/base/context-version.pdf b/tex/context/base/context-version.pdf Binary files differindex edd770ee2..93c46df4c 100644 --- a/tex/context/base/context-version.pdf +++ b/tex/context/base/context-version.pdf diff --git a/tex/context/base/context.mkiv b/tex/context/base/context.mkiv index fde3ea3ab..ad67b3668 100644 --- a/tex/context/base/context.mkiv +++ b/tex/context/base/context.mkiv @@ -25,7 +25,7 @@ %D up and the dependencies are more consistent. \edef\contextformat {\jobname} -\edef\contextversion{2013.09.19 09:20} +\edef\contextversion{2013.09.19 13:52} \edef\contextkind {beta} %D For those who want to use this: diff --git a/tex/context/base/font-odv.lua b/tex/context/base/font-odv.lua index 164377e80..7437bd8c3 100644 --- a/tex/context/base/font-odv.lua +++ b/tex/context/base/font-odv.lua @@ -100,11 +100,11 @@ local methods = fonts.analyzers.methods local otffeatures = fonts.constructors.newfeatures("otf") local registerotffeature = otffeatures.register -local insert_node_after = node.insert_after -local copy_node = node.copy -local free_node = node.free -local remove_node = node.remove -local flush_list = node.flush_list +local insert_node_after = nodes.insert_after +local copy_node = nodes.copy +local free_node = nodes.free +local remove_node = nodes.remove +local flush_list = nodes.flush_list local unsetvalue = attributes.unsetvalue @@ -577,7 +577,7 @@ local function deva_reorder(head,start,stop,font,attr,nbspaces) free_node(current) return head, stop else - nbspaces[current] = true + nbspaces = nbspaces + 1 base = current firstcons = current lastcons = current @@ -880,8 +880,8 @@ local function deva_reorder(head,start,stop,font,attr,nbspaces) cns = next end elseif char == c_nbsp then - nbspaces[current] = true - cns = current + nbspaces = nbspaces + 1 + cns = current local next = cns.next if halant[next.char] then cns = next @@ -893,12 +893,12 @@ local function deva_reorder(head,start,stop,font,attr,nbspaces) end if base.char == c_nbsp then - nbspaces[base] = nil + nbspaces = nbspaces - 1 head = remove_node(head,base) free_node(base) end - return head, stop + return head, stop, nbspaces end -- If a pre-base matra character had been reordered before applying basic features, @@ -1398,7 +1398,7 @@ local function dev2_reorder(head,start,stop,font,attr,nbspaces) -- maybe do a pa return head, stop else if is_nbsp then - nbspaces[current] = true + nbspaces = nbspaces + 1 end base = current current = current.next @@ -1609,12 +1609,12 @@ local function dev2_reorder(head,start,stop,font,attr,nbspaces) -- maybe do a pa end if base.char == c_nbsp then - nbspaces[base] = nil + nbspaces = nbspaces - 1 head = remove_node(head, base) free_node(base) end - return head, stop + return head, stop, nbspaces end -- cleaned up and optimized ... needs checking (local, check order, fixes, extra hash, etc) @@ -1674,9 +1674,9 @@ local function analyze_next_chars_one(c,font,variant) -- skip one dependent vowe if nv and zw_char[n.char] then n = nn nn = nn.next - nv = nn.id == glyph_code and nn.subtype<256 and nn.font == font + nv = nn and nn.id == glyph_code and nn.subtype<256 and nn.font == font end - if nn and nv and halant[n.char] and consonant[nn.char] then + if nv and halant[n.char] and consonant[nn.char] then c = nn end end @@ -1940,7 +1940,7 @@ function methods.deva(head,font,attr) local current = head local start = true local done = false - local nbspaces = { } + local nbspaces = 0 while current do if current.id == glyph_code and current.subtype<256 and current.font == font then done = true @@ -1972,7 +1972,7 @@ function methods.deva(head,font,attr) local syllableend = analyze_next_chars_one(c,font,2) current = syllableend.next if syllablestart ~= syllableend then - head, current = deva_reorder(head,syllablestart,syllableend,font,attr,nbspaces) + head, current, nbspaces = deva_reorder(head,syllablestart,syllableend,font,attr,nbspaces) current = current.next end else @@ -2081,7 +2081,7 @@ function methods.deva(head,font,attr) end end if syllablestart ~= syllableend then - head, current = deva_reorder(head,syllablestart,syllableend,font,attr,nbspaces) + head, current, nbspaces = deva_reorder(head,syllablestart,syllableend,font,attr,nbspaces) current = current.next end elseif independent_vowel[char] then @@ -2120,9 +2120,12 @@ function methods.deva(head,font,attr) start = false end - if next(nbspaces) then - head = replace_all_nbsp(head,nbspaces) + if nbspaces > 0 then + head = replace_all_nbsp(head) end + + head = typesetters.characters.handler(head) + return head, done end @@ -2136,7 +2139,7 @@ function methods.dev2(head,font,attr) local start = true local done = false local syllabe = 0 - local nbspaces = { } + local nbspaces = 0 while current do local syllablestart, syllableend = nil, nil if current.id == glyph_code and current.subtype<256 and current.font == font then @@ -2158,7 +2161,7 @@ function methods.dev2(head,font,attr) else local standalone = char == c_nbsp if standalone then - nbspaces[current] = true + nbspaces = nbspaces + 1 local p = current.prev if not p then -- begin of paragraph or box @@ -2193,7 +2196,7 @@ function methods.dev2(head,font,attr) end end if syllableend and syllablestart ~= syllableend then - head, current = dev2_reorder(head,syllablestart,syllableend,font,attr,nbspaces) + head, current, nbspaces = dev2_reorder(head,syllablestart,syllableend,font,attr,nbspaces) end if not syllableend and current.id == glyph_code and current.subtype<256 and current.font == font and not current[a_state] then local mark = mark_four[current.char] @@ -2204,8 +2207,9 @@ function methods.dev2(head,font,attr) start = false current = current.next end - if next(nbspaces) then - head = replace_all_nbsp(head,nbspaces) + + if nbspaces > 0 then + head = replace_all_nbsp(head) end return head, done diff --git a/tex/context/base/spac-chr.lua b/tex/context/base/spac-chr.lua index d59725edf..db98b42a6 100644 --- a/tex/context/base/spac-chr.lua +++ b/tex/context/base/spac-chr.lua @@ -22,9 +22,10 @@ report_characters = logs.reporter("typesetting","characters") local nodes, node = nodes, node -local insert_node_after = node.insert_after -local remove_node = nodes.remove -- ! nodes -local copy_node_list = node.copy_list +local insert_node_after = nodes.insert_after +local remove_node = nodes.remove +local copy_node_list = nodes.copy_list +local traverse_id = nodes.traverse_id local tasks = nodes.tasks @@ -112,16 +113,20 @@ end -- assumes nuts or nodes, depending on callers .. so no tonuts here -function characters.replacenbsp(head,current) - head, current = nbsp(head,current) - head, current = remove_node(head,current,true) +function characters.replacenbsp(head,original) + local head, current = nbsp(head,original) + head = remove_node(head,original,true) return head, current end -function characters.replacenbspaces(head,nbspaces) - for current in next, nbspaces do - head, current = nbsp(head,current) - head, current = remove_node(head,current,true) +function characters.replacenbspaces(head) + for current in traverse_id(glyph_code,head) do + if current.char == 0x00A0 then + local h = nbsp(head,current) + if h then + head = remove_node(h,current,true) + end + end end return head end @@ -141,34 +146,18 @@ local methods = { -- The next one uses an attribute assigned to the character but still we -- don't have the 'local' value. - -- [0x00A0] = function(head,current) -- nbsp - -- local next = current.next - -- if next and next.id == glyph_code then - -- local char = next.char - -- if char >= 0x00900 and char <= 0x0097F then - -- return false -- devangari - -- end - -- if char >= 0x00C80 and char <= 0x00CFF then - -- return false -- kannada - -- end - -- end - -- local prev = current.prev - -- if prev and prev.id == glyph_code then - -- local char = prev.char - -- if char >= 0x00900 and char <= 0x0097F then - -- return false -- devangari - -- end - -- if char >= 0x00C80 and char <= 0x00CFF then - -- return false -- kannada - -- end - -- end - -- return nbsp(head,current) - -- end, - [0x00A0] = function(head,current) -- nbsp local next = current.next - if next and next.id == glyph_code and nbsphash[next.char] then - return false + if next and next.id == glyph_code then + local char = next.char + if char == 0x200C or char == 0x200D then -- nzwj zwj + next = next.next + if next and nbsphash[next.char] then + return false + end + elseif nbsphash[char] then + return false + end end local prev = current.prev if prev and prev.id == glyph_code and nbsphash[prev.char] then diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf Binary files differindex 22d672c62..90791c6b9 100644 --- a/tex/context/base/status-files.pdf +++ b/tex/context/base/status-files.pdf diff --git a/tex/context/base/status-lua.log b/tex/context/base/status-lua.log index bc318b8ed..27cb2d27d 100644 --- a/tex/context/base/status-lua.log +++ b/tex/context/base/status-lua.log @@ -1,6 +1,6 @@ (cont-yes.mkiv -ConTeXt ver: 2013.09.19 09:20 MKIV beta fmt: 2013.9.19 int: english/english +ConTeXt ver: 2013.09.19 13:52 MKIV beta fmt: 2013.9.19 int: english/english system > 'cont-new.mkiv' loaded (cont-new.mkiv) diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index f8e3e802e..6251ec816 100644 --- a/tex/generic/context/luatex/luatex-fonts-merged.lua +++ b/tex/generic/context/luatex/luatex-fonts-merged.lua @@ -1,6 +1,6 @@ -- merged file : luatex-fonts-merged.lua -- parent file : luatex-fonts.lua --- merge date : 09/19/13 09:20:57 +-- merge date : 09/19/13 13:52:26 do -- begin closure to overcome local limits and interference |