summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/mkiv/typo-brk.lua
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/context/base/mkiv/typo-brk.lua')
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/typo-brk.lua30
1 files changed, 12 insertions, 18 deletions
diff --git a/Master/texmf-dist/tex/context/base/mkiv/typo-brk.lua b/Master/texmf-dist/tex/context/base/mkiv/typo-brk.lua
index 76e50ce1859..51760bbf48d 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/typo-brk.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/typo-brk.lua
@@ -23,6 +23,7 @@ local settings_to_array = utilities.parsers.settings_to_array
local nuts = nodes.nuts
local tonut = nuts.tonut
+local tonode = nuts.tonode
local getnext = nuts.getnext
local getprev = nuts.getprev
@@ -75,14 +76,14 @@ local new_wordboundary = nodepool.wordboundary
local nodecodes = nodes.nodecodes
local kerncodes = nodes.kerncodes
+local glyph_code = nodecodes.glyph
local kern_code = nodecodes.kern
local math_code = nodecodes.math
local fontkern_code = kerncodes.fontkern
+----- userkern_code = kerncodes.userkern
local italickern_code = kerncodes.italiccorrection
-local is_letter = characters.is_letter
-
local typesetters = typesetters
typesetters.breakpoints = typesetters.breakpoints or {}
@@ -240,9 +241,10 @@ end
function breakpoints.handler(head)
local done = false
+ local nead = tonut(head)
local attr = nil
local map = nil
- local current = head
+ local current = nead
while current do
local char, id = isglyph(current)
if char then
@@ -311,7 +313,7 @@ function breakpoints.handler(head)
end
end
if not done then
- return head
+ return head, false
end
-- we have hits
local numbers = languages.numbers
@@ -321,21 +323,17 @@ function breakpoints.handler(head)
local stop = data[2]
local cmap = data[3]
local smap = data[4]
--- -- we do a sanity check for language
-- local lang = getlang(start)
+-- -- we do a sanity check for language
-- local smap = lang and lang >= 0 and lang < 0x7FFF and (cmap[numbers[lang]] or cmap[""])
-- if smap then
local nleft = smap.nleft
local cleft = 0
local prev = getprev(start)
- local kern = nil
+ local kern = nil
while prev and nleft ~= cleft do
- local char, id = isglyph(prev)
- if char then
- if not is_letter[char] then
- cleft = -1
- break
- end
+ local id = getid(prev)
+ if id == glyph_code then
cleft = cleft + 1
prev = getprev(prev)
elseif id == kern_code then
@@ -361,10 +359,6 @@ function breakpoints.handler(head)
while next and nright ~= cright do
local char, id = isglyph(next)
if char then
- if not is_letter[char] then
- cright = -1
- break
- end
if cright == 1 and cmap[char] then
-- let's not make it too messy
break
@@ -389,13 +383,13 @@ function breakpoints.handler(head)
if nright == cright then
local method = methods[smap.type]
if method then
- head, start = method(head,start,stop,smap,kern)
+ nead, start = method(nead,start,stop,smap,kern)
end
end
-- end
end
end
- return head
+ return tonode(nead), true
end
local enabled = false