diff options
Diffstat (limited to 'Master/texmf-dist/tex/context/base/typo-brk.lua')
-rw-r--r-- | Master/texmf-dist/tex/context/base/typo-brk.lua | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/Master/texmf-dist/tex/context/base/typo-brk.lua b/Master/texmf-dist/tex/context/base/typo-brk.lua index 14f0b8b4744..d6326ebebc8 100644 --- a/Master/texmf-dist/tex/context/base/typo-brk.lua +++ b/Master/texmf-dist/tex/context/base/typo-brk.lua @@ -20,16 +20,14 @@ local report_breakpoints = logs.reporter("typesetting","breakpoints") local nodes, node = nodes, node local settings_to_array = utilities.parsers.settings_to_array -local has_attribute = node.has_attribute -local unset_attribute = node.unset_attribute -local set_attribute = node.set_attribute local copy_node = node.copy local copy_nodelist = node.copy_list local free_node = node.free local insert_node_before = node.insert_before local insert_node_after = node.insert_after local remove_node = nodes.remove -- ! nodes -local link_nodes = nodes.link + +local tonodes = nodes.tonodes local texattribute = tex.attribute local unsetvalue = attributes.unsetvalue @@ -139,10 +137,18 @@ methods[5] = function(head,start,settings) -- x => p q r head, start, tmp = remove_node(head,start) head, start = insert_node_before(head,start,new_disc()) local attr = tmp.attr + local font = tmp.font start.attr = copy_nodelist(attr) -- todo: critical only - start.pre = link_nodes(settings.right,tmp,attr) - start.post = link_nodes(settings.left,tmp,attr) - start.replace = link_nodes(settings.middle,tmp,attr) + local left, right, middle = settings.left, settings.right, settings.middle + if left then + start.pre = tonodes(tostring(left),font,attr) -- was right + end + if right then + start.post = tonodes(tostring(right),font,attr) -- was left + end + if middle then + start.replace = tonodes(tostring(middle),font,attr) + end free_node(tmp) insert_break(head,start,10000,10000) end @@ -155,9 +161,9 @@ local function process(namespace,attribute,head) while start do local id = start.id if id == glyph_code then - local attr = has_attribute(start,a_breakpoints) + local attr = start[a_breakpoints] if attr and attr > 0 then - unset_attribute(start,a_breakpoints) -- maybe test for subtype > 256 (faster) + start[a_breakpoints] = unsetvalue -- maybe test for subtype > 256 (faster) -- look ahead and back n chars local data = mapping[attr] if data then |