[NTG-context] Summing up ligature prevention tests

denis.maier at ub.unibe.ch denis.maier at ub.unibe.ch
Wed Mar 24 20:24:34 CET 2021

Trying to sum up what we currently have regarding ligature prevention, it looks like we have three mechanisms available:

1. \replaceword[set][input][output]
Ex.: \replaceword[ligs][Auflage][Au{fl}age]
Replaces a word input with the corresponding output.
Doesn't work at the moment with LMTX.
Can be used for words with multiple wrong ligatures (Auflaufform).
Does not take derived forms into account (e.g., replacements for Auflage and Auflagen must both be defined).

2. \blockligatures
Works as a font feature to block certain ligatures
Works also for derived forms of a given word (e.g., \blockligatures[Au:fl:age] will also block the fl-ligature in "Auflagen").
Currently, can't be used when multiple ligatures should be suppressed. \blockligatures[Au:fl:au:ff:orm] blocks the fl-ligature, but the ff-ligature still shows up. This here seems to works though:
\blockligatures [
Don't know if there are unwanted side-effects to that approach.

3. \startexceptions
Works via hyphenation exceptions. To define exceptions for "Auflage" and "Auflaufform" use:
au{f-}{l}{fl}(f\zwnj l)age
Au{f-}{l}{fl}(f\zwnj l)au{f-}{f}{ff}(f\zwnj f)orm

This does not work automatically for derived forms; you'll have to define plural and other forms as well.
As this works with hyphenation exceptions you'll have to add legal hyphenation points as well, so for "Auflage", you will actually need:
au{f-}{l}{fl}(f\zwnj l)a-ge

IMO, the \blockligatures is the cleanest, both conceptually and syntax wise. Being able to implicitely disable derived forms is a big plus, but of course there may be drawbacks I don't see now. The only downsides I see currently is that you need workarounds to block multiple ligatures in a single words, of which there might not be too many. And, it's kind of an "all or nothing" approach as you cannot define sets of blocked ligatures. (But that may not be a relevant use case anyway.)

Anything, I've missed? Other aspects to think about here? How about performance issues? (The blockligatures-mechanism resulted in this: with a word list of about 2200 words it took a bit more than five seconds to process 23 A5 pages than 2.5 seconds without the blocked ligatures. I'll test with the other methods later or tomorrow.)


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ntg.nl/pipermail/ntg-context/attachments/20210324/53a0e349/attachment.htm>

More information about the ntg-context mailing list