diff options
author | Karl Berry <karl@freefriends.org> | 2018-03-20 22:10:59 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2018-03-20 22:10:59 +0000 |
commit | 65d009a0596b194597f47531523addd3e64ed005 (patch) | |
tree | e13bd9beecf63e26491a66aa7a8fa702482f0067 /Master/texmf-dist/tex/generic/context/luatex/luatex-basics-nod.lua | |
parent | d1a186333ced7b341e26877907343f08211199f7 (diff) |
context [current] (20mar18)
git-svn-id: svn://tug.org/texlive/trunk@47050 c570f23f-e606-0410-a88d-b1316a301751
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 + |