Re: [NTG-context] Summing up ligature prevention tests

2021-03-25 Thread Hans Hagen

On 3/24/2021 11:43 PM, denis.ma...@ub.unibe.ch wrote:

So, what's the general recommendation? Which approach is the best in your 
opinion? (In case it's the \replaceword approach: do you think you'll have time 
to look into this?)

I've seen in an older thread that the best way to deal with this would be in 
the hyphenator. What do you think about this now, a couple of years later?

And, while we're at it: how do you deal with words like "begrifflich" where 
you'll want the ff ligature, but not the ffl ligature.
I've tried this
\replaceword[ligs][begrifflich][begri{ffl}ich]
But this breaks the ligature completely.
\replaceword[ligs][begrifflich][begrif{fl}ich] is not correct either (doesn't 
do anything).

Or with exceptions:
\startexceptions[de]
begri{ff-}{l}{ffl}(ff\zwnj l)ich
\stopexceptions

But that also breaks the ligature completely.
only in lmtx ... i'll check it (probably some interference with compact 
fonts mode)


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
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Summing up ligature prevention tests

2021-03-25 Thread denis.maier
> -Ursprüngliche Nachricht-
> Von: Hans Hagen 
> Gesendet: Donnerstag, 25. März 2021 11:02
> An: Maier, Denis Christian (UB) ; ntg-
> cont...@ntg.nl
> Betreff: Re: AW: [NTG-context] Summing up ligature prevention tests
> 
> On 3/24/2021 11:43 PM, denis.ma...@ub.unibe.ch wrote:
> > So, what's the general recommendation? Which approach is the best in
> > your opinion? (In case it's the \replaceword approach: do you think
> > you'll have time to look into this?)
> >
> > I've seen in an older thread that the best way to deal with this would be in
> the hyphenator. What do you think about this now, a couple of years later?
> >
> > And, while we're at it: how do you deal with words like "begrifflich" where
> you'll want the ff ligature, but not the ffl ligature.
> > I've tried this
> > \replaceword[ligs][begrifflich][begri{ffl}ich]
> > But this breaks the ligature completely.
> > \replaceword[ligs][begrifflich][begrif{fl}ich] is not correct either 
> > (doesn't do
> anything).
> >
> > Or with exceptions:
> > \startexceptions[de]
> > begri{ff-}{l}{ffl}(ff\zwnj l)ich
> > \stopexceptions
> >
> > But that also breaks the ligature completely.
> Todays secret:
> 
> \starttext
> 
> \registerhyphenationpattern[nl][e1ë/e=e]
> \registerhyphenationpattern[nl][a9atje./a=t,1,3]
> \registerhyphenationpattern[en][eigh1tee/t=t,5,1]
> \registerhyphenationpattern[de][c1k/k=k]
> \registerhyphenationpattern[de][schif1f/ff=f,5,2]
> 
> \starthyphenation[traditional]
>  \starttabulate[|||]
>  \NC reëel  \NC \language[nl]\hyphenatedcoloredword{reëel}
>  \NC \NR
>  \NC omaatje\NC \language[nl]\hyphenatedcoloredword{omaatje}
> \NC \NR
>  \NC eighteen   \NC
> \language[en]\hyphenatedcoloredword{eighteen}   \NC \NR
>  \NC Zucker \NC \language[de]\hyphenatedcoloredword{Zucker}
>  \NC \NR
>  \NC Schiffahrt \NC
> \language[de]\hyphenatedcoloredword{Schiffahrt} \NC \NR
>  \stoptabulate
> \stophyphenation
> 
> \stoptext
> 
> I think only Pablo ever used this variant. And yes, it's actually documented 
> in
> a manual. But it's old code thay I might want to update to be more lmtx-ish.
> 
> Hans

Yes, that's in the "languages" manual. But I don't understand how this will 
help with the ligatures?

\registerhyphenationpattern[de][.begriff1l/ff=l,6,3] Gives me correct 
hyphenation of begrifflich, but has no effect on ligatures (see below).

Denis


\starttext

\registerhyphenationpattern[de][.begriff1l/ff=l,6,3]

\starthyphenation[traditional]
\language[de] begrifflich \hyphenatedcoloredword{begrifflich}

\stophyphenation

\language[de] begrifflich \hyphenatedcoloredword{begrifflich}

\stoptext
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Summing up ligature prevention tests

2021-03-25 Thread Hans Hagen

On 3/24/2021 11:43 PM, denis.ma...@ub.unibe.ch wrote:

So, what's the general recommendation? Which approach is the best in your 
opinion? (In case it's the \replaceword approach: do you think you'll have time 
to look into this?)

I've seen in an older thread that the best way to deal with this would be in 
the hyphenator. What do you think about this now, a couple of years later?

And, while we're at it: how do you deal with words like "begrifflich" where 
you'll want the ff ligature, but not the ffl ligature.
I've tried this
\replaceword[ligs][begrifflich][begri{ffl}ich]
But this breaks the ligature completely.
\replaceword[ligs][begrifflich][begrif{fl}ich] is not correct either (doesn't 
do anything).

Or with exceptions:
\startexceptions[de]
begri{ff-}{l}{ffl}(ff\zwnj l)ich
\stopexceptions

But that also breaks the ligature completely.

Todays secret:

\starttext

\registerhyphenationpattern[nl][e1ë/e=e]
\registerhyphenationpattern[nl][a9atje./a=t,1,3]
\registerhyphenationpattern[en][eigh1tee/t=t,5,1]
\registerhyphenationpattern[de][c1k/k=k]
\registerhyphenationpattern[de][schif1f/ff=f,5,2]

\starthyphenation[traditional]
\starttabulate[|||]
\NC reëel  \NC \language[nl]\hyphenatedcoloredword{reëel} 
\NC \NR
\NC omaatje\NC \language[nl]\hyphenatedcoloredword{omaatje} 
   \NC \NR
\NC eighteen   \NC 
\language[en]\hyphenatedcoloredword{eighteen}   \NC \NR
\NC Zucker \NC \language[de]\hyphenatedcoloredword{Zucker} 
\NC \NR
\NC Schiffahrt \NC 
\language[de]\hyphenatedcoloredword{Schiffahrt} \NC \NR

\stoptabulate
\stophyphenation

\stoptext

I think only Pablo ever used this variant. And yes, it's actually 
documented in a manual. But it's old code thay I might want to update to 
be more lmtx-ish.


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
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Summing up ligature prevention tests

2021-03-24 Thread denis.maier
So, what's the general recommendation? Which approach is the best in your 
opinion? (In case it's the \replaceword approach: do you think you'll have time 
to look into this?) 

I've seen in an older thread that the best way to deal with this would be in 
the hyphenator. What do you think about this now, a couple of years later?

And, while we're at it: how do you deal with words like "begrifflich" where 
you'll want the ff ligature, but not the ffl ligature.
I've tried this
\replaceword[ligs][begrifflich][begri{ffl}ich]
But this breaks the ligature completely. 
\replaceword[ligs][begrifflich][begrif{fl}ich] is not correct either (doesn't 
do anything).

Or with exceptions:
\startexceptions[de]
begri{ff-}{l}{ffl}(ff\zwnj l)ich
\stopexceptions

But that also breaks the ligature completely.

Denis

> -Ursprüngliche Nachricht-
> Von: Hans Hagen 
> Gesendet: Mittwoch, 24. März 2021 23:16
> An: mailing list for ConTeXt users ; Maier, Denis
> Christian (UB) 
> Betreff: Re: [NTG-context] Summing up ligature prevention tests
> 
> On 3/24/2021 8:24 PM, denis.ma...@ub.unibe.ch wrote:
> 
> > 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.)
> of course there is always more:
> 
> \starttext
> 
>  {effie}
>  {ef{\norightligaturing f}ie}
>  {ef{\noleftligaturing f}ie}
>  {ef{\noleftligaturing\norightligaturing f}ie}
>  {ef{\noligaturing f}ie}
>  {\noligaturing effie}
> 
> \stoptext
> 
> (con)tex(t) is all about control (and secret features),
> 
> (and yes: there's also \noleftkerning etc)
> 
> 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
> -
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Summing up ligature prevention tests

2021-03-24 Thread Hans Hagen

On 3/24/2021 8:24 PM, denis.ma...@ub.unibe.ch wrote:

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.)

of course there is always more:

\starttext

{effie}
{ef{\norightligaturing f}ie}
{ef{\noleftligaturing f}ie}
{ef{\noleftligaturing\norightligaturing f}ie}
{ef{\noligaturing f}ie}
{\noligaturing effie}

\stoptext

(con)tex(t) is all about control (and secret features),

(and yes: there's also \noleftkerning etc)

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
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] Summing up ligature prevention tests

2021-03-24 Thread denis.maier
Hi,
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 [
Au:fl:auf,
au:ff:orm,
]
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:
\startexceptions[de]
au{f-}{l}{fl}(f\zwnj l)age
Au{f-}{l}{fl}(f\zwnj l)au{f-}{f}{ff}(f\zwnj f)orm
\stopexceptions

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:
\startexceptions[de]
au{f-}{l}{fl}(f\zwnj l)a-ge
\stopexceptions

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.)

Denis



___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___