diff options
Diffstat (limited to 'Master/texmf-dist/tex/generic/context/luatex/luatex-basics-nod.lua')
-rw-r--r-- | Master/texmf-dist/tex/generic/context/luatex/luatex-basics-nod.lua | 54 |
1 files changed, 36 insertions, 18 deletions
diff --git a/Master/texmf-dist/tex/generic/context/luatex/luatex-basics-nod.lua b/Master/texmf-dist/tex/generic/context/luatex/luatex-basics-nod.lua index f9a59734bde..40fb9ee4ef6 100644 --- a/Master/texmf-dist/tex/generic/context/luatex/luatex-basics-nod.lua +++ b/Master/texmf-dist/tex/generic/context/luatex/luatex-basics-nod.lua @@ -48,7 +48,6 @@ end -- Nodes (a subset of context so that we don't get too much unused code): nodes = { } -nodes.pool = { } nodes.handlers = { } local nodecodes = { } @@ -73,7 +72,6 @@ nodes.disccodes = disccodes local flush_node = node.flush_node local remove_node = node.remove -local new_node = node.new local traverse_id = node.traverse_id nodes.handlers.protectglyphs = node.protect_glyphs @@ -108,12 +106,6 @@ function nodes.delete(head,current) return nodes.remove(head,current,true) end -function nodes.pool.kern(k) - local n = new_node("kern",1) - n.kern = k - return n -end - local getfield = node.getfield local setfield = node.setfield @@ -209,6 +201,7 @@ nuts.setchar = direct.setchar nuts.getdisc = direct.getdisc nuts.setdisc = direct.setdisc nuts.setlink = direct.setlink +nuts.setsplit = direct.setsplit nuts.getlist = direct.getlist nuts.setlist = direct.setlist @@ -294,20 +287,11 @@ nuts.traverse_id = direct.traverse_id nuts.traverse_char = direct.traverse_char nuts.ligaturing = direct.ligaturing nuts.kerning = direct.kerning +nuts.new = direct.new nuts.getprop = nuts.getattr nuts.setprop = nuts.setattr -local new_nut = direct.new -nuts.new = new_nut -nuts.pool = { } - -function nuts.pool.kern(k) - local n = new_nut("kern",1) - setfield(n,"kern",k) - return n -end - -- properties as used in the (new) injector: local propertydata = direct.get_properties_table() @@ -462,3 +446,37 @@ function nuts.copy_only_glyphs(current) end return head end + +nuts.uses_font = direct.uses_font + +if not nuts.uses_font then + local getdisc = nuts.getdisc + local getfont = nuts.getfont + function nuts.uses_font(n,font) + local pre, post, replace = getdisc(n) + if pre then + -- traverse_char + for n in traverse_id(glyph_code,pre) do + if getfont(n) == font then + return true + end + end + end + if post then + for n in traverse_id(glyph_code,post) do + if getfont(n) == font then + return true + end + end + end + if replace then + for n in traverse_id(glyph_code,replace) do + if getfont(n) == font then + return true + end + end + end + return false + end +end + |