[luatex] luatex Digest, Vol 57, Issue 6

Mico Loretan mico.loretan at mac.com
Tue Sep 17 18:48:45 CEST 2013

On Sep 17, 2013, at 12:00 PM, Paul Isambert wrote:
> Message: 1
> Date: Mon, 16 Sep 2013 12:27:55 +0200
> From: Paul Isambert <zappathustra at free.fr>
> To: "LuaTeX discussion." <luatex at tug.org>
> Subject: Re: [luatex] need help inserting a special character into the
> 	input	stream
> Message-ID:
> 	<79375849.149542474.1379327275704.JavaMail.root at zimbra54-e10.priv.proxad.net>
> Content-Type: text/plain; charset="utf-8"
> One question (I did not review the code):
>> Here's the problem: While **something** definitely ends up being
>> inserted into the node list, it doesn't appear to be a ZWNJ
>> character.
> Is there a glyph corresponding to that character in the font?
> Best,
> Paul

I 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. Nevertheless, being able to typeset it properly is important because some the "Contextuals=Alternate" setting of some fonts can make use of the presence to "decide" how to render the glyph that precedes it.

Here's the specific application for inserting a ZWNJ character that I have in mind: The font family EB Garamond has a "lowercase-f" glyph that has a long "arm" that hangs fairly far out to the right (as do virtually all Garaldes). This causes collisions with subsequent glyphs such as b, h, i, j, k, and l if the corresponding f-ligatures are suppressed. Why would one want to suppress these f-ligatures? In German typography, for one, the word "Auflage" should be typeset without the fl ligature since it spans a morpheme boundary. Because of the long right-leaning arm of the "f" glyph, an unsightly collision between the f and the subsequent l. However, this font also has a "short-armed lowercase-f" glyph and "Contextuals=Alternate" setting that says that the ordinary (long-armed) f glyph should be replaced by its short-armed variant if the f is followed by a ZWNJ character. Now, it's of course possible to insert a \char"200c instruction by hand, but I'm trying to train the selnolig package -- which does automated ligature suppression... -- to insert a ZWNJ character whenever an f-ligature should be suppressed because of morpheme boundary crossing issue.

The lua code of the selnolig package -- check it out at https://github.com/micoloretan/selnolig/selnolig.lua; the crucial code snippets were posted in my initial message to this group -- has macros to set up rules for automated ligature suppression. It works reasonably, i.e., it succeeds in breaking up the ligatures, but I'd like to change the item that's being inserted from a "whatsit" to a ZWNJ character. This would make the package very useful for people who use the EB Garamond font as well, it it would let them make use of its Contextuals=Alternate to use the font's short-armed-f glyph.

Sorry for this longish explanation; I hope some will find this background information useful.

Thanks, Mico

More information about the luatex mailing list