[luatex] need help inserting a special character into the input stream

Mico Loretan mico.loretan at mac.com
Sun Sep 15 18:35:39 CEST 2013


I have a feeling the following shouldn't be difficult to accomplish, but somehow I'm not succeeding. Advice/critiques/suggestions welcome!

I'm trying to insert a specific character, a so-called "zero width non joining" character (unicode point "200C) into specific points in the node stream. So far, I've tried to create such a node via

     local zwnjnode = node.new(glyph)
     zwnj.type      = 1
     zwnjnode.char  = unicode2utf("200C")

where "glyph" is created via 

     glyph   = node.id('glyph')

and unicode2utf is a function whose only instruction is

     return unicode.utf8.char(tonumber(c,16))

and 'c' would be "200C". Later on in the code, these zwnjnode objects are inserted into the node list via

      node.insert_before(hh, curr, node.copy(zwnjnode) )

where "curr" is the current node processed by node.traverse


Here's the problem: While **something** definitely ends up being inserted into the node list, it doesn't appear to be a ZWNJ character. If somebody could help me figure out the error(s) in my ways, I'd be much obliged. Is a ZWNJ character maybe not suitable for a node of type "glyph"? Am I doing something wrong in the process of creating the zwnjnode objects? Please advise.

Many thanks in advance,

Mico




More information about the luatex mailing list