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

Mico Loretan mico.loretan at mac.com
Mon Sep 23 20:05:43 CEST 2013


It turns out that the real issue was simultaneously less and more difficult than I thought it was. 

The good news was that there was no bug in my code, i.e., the ZWNJ character was being inserted into the node list just fine. 

The problem, then, was that the function doing the work was registered as a "ligaturing" callback. Such functions take two inputs but don't return anything. Hence the odd experience that the code seemed to be correct yet didn't seem to do anything tangible.

Switching the function to a "pre_linebreak_filter" callback (which takes one input -- a list of nodes -- and produces one output -- a list of modified nodes) solved my problem. 

Sincerely, Mico

On Sep 18, 2013, at 12:00 PM, luatex-request at tug.org wrote:
> 
> Message: 2
> Date: Wed, 18 Sep 2013 09:55:07 +0100
> From: Graham Douglas <graham.douglas at readytext.co.uk>
> To: <luatex at tug.org>
> Subject: Re: [luatex] luatex Digest, Vol 57, Issue 6
> Message-ID: <52396A6B.7070400 at readytext.co.uk>
> Content-Type: text/plain; charset="ISO-8859-1"
> 
> Hi Mico
> 
> Just a comment on:
> 
> "...believe the "glyph" corresponding to the ZWNJ character (hex "200c)
> is "invisible", in the sense that it has zero width. Hence, nothing
> shows up visually. "
> 
> Not quite. (Ignoring CJK fonts which I know nothing about) a glyph with
> "zero width" means that it has zero advance width -- ie, it does not
> affect the "current horizontal position" in the typesetting engine (or
> display) but that does not mean it is "invisible". For example, many
> Arabic vowel glyphs also have zero width but, of course, they display
> correctly. You can of course use the ZWNJ **character** for various
> text-processing applications and never need to actually display it.
> Unless your font has the corresponding **glyph** to represent it
> visually then, of course, it will not display when using fonts that do
> not have a glyph for the ZWNJ. The visual representation of the ZWNJ
> character varies quite a lot depending on the font being being used.
> 
> Best
> Graham
> 



More information about the luatex mailing list