[NTG-context] Consequences of \zwnj for hyphenation

Hans Hagen j.hagen at xs4all.nl
Wed Oct 14 14:58:31 CEST 2020


On 10/14/2020 2:09 PM, Denis Maier wrote:
> Hi,
> has \zwnj (or the equivalent unicode character) bad consequences for 
> hyphenation? Like, when you'd preprocess your files and add \zwnj in 
> appropriate places, will that break hyphenation for these words?
So, this:

\mainlanguage[nl]

\startexceptions[nl]
wis-kun-d{e-}{o}{eo}(e-o)n-der-wijs
\stopexceptions

wiskundeonderwijs

\hsize 1mm

wiskundeonderwijs

results in

wiskunde-onderwijs

wis-
kun-
de-
on-
der-
wijs

with proper kerning and ligatures when applicable and

\startexceptions[nl]
wis-kun-d{e-}{o}{eo}(e\zwj o)n-der-wijs
\stopexceptions

will do the same but no compound dash. It's actually mostly a matter of 
communicating with the font handler (without hard coding solutions in 
the engine).

As a side effect (teaser) you can do this in the upcoming lmtx:

\definefontfeature[whatever][default][mode=base]
\definefont[myfont][Serif*whatever]

{\myfont               test effe every}\quad
{                      test effe every}\par
{\myfont \nokerning    test effe every}\quad
{        \nokerning    test effe every}\par
{\myfont \noligaturing test effe every}\quad
{        \noligaturing test effe every}\par
{\myfont               test effe e{\nokerning v}ery}\quad
{                      test effe e{\nokerning v}ery}\par

with \nokerning and \noligaturing being macros that set some options 
(the old \noligs and \nokerns have therefore been dropped) ... so one 
has local control over matters (base mode and node mode).

one can even control left/right kerning/ligaturing this way but that's 
something to be explained in some article or at some user meeting or so 
(after all i occasionally need something new to tell)

so, in the end all you have to do is come up with a list of exceptions

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------


More information about the ntg-context mailing list