Re: [NTG-context] ligature exceptions

2021-07-28 Thread Hans Hagen via ntg-context

On 7/28/2021 7:24 PM, Thomas A. Schmitz via ntg-context wrote:

Hi all,

just two quick questions: a couple of weeks ago, there was a long 
discussion on ligature exceptions in, e.g., German. Hans provided an 
elegant new mechanism (\startlanguageoptions). So my two questions:


1. Is the old mechanism (\replaceword[eg][Auflage][Au{fl}age]) now 
obsolete? I tried using it, but unwanted ligatures still occurred. If it 
is indeed deprecated, I'll add a note to the wiki (this would mean that 
the current texlive version does not have the new mechanism and the 
latest lmtx doesn't use the old one, so that's somewhat problematic).


it's not too hard to make it work, see attached, but the new one is 
nicer because it permits more detailed control


in luametatex you can do things like

Au{\norightligaturing f}lage

that is: each character can have a set of options; ok, one can do that 
with attributes but that is less efficients options have been introduced 
for ligatures, kerns, expansion etc (you can diff the attached lmt file 
with the lua file of the same name to see the difference in approach


2. Both mechanisms only work for complete words, is that right? So I 
can't just provide a pattern such as "uf|forder," I have to provide a 
full list with all inflected forms:


auf|fordern
auf|fordert
auf|fordernd
Auf|forderung
Auf|forderungen

and for 1-3 also the forms with a capital letter.


just lowercase will do

if you look at the example files you can see that there are pre/post 
snippets possibel so basically you can create something


pre [a|b|c] post

which saves some definitions (make we can have pre/post lists which will 
nicely explode into huge lists but memory is not the issue here)


while the replacement works by running over the node list, the second 
mechanism is using a callback at the hyphenation level (so per language) 
where each word is anyway checked against an exception list, so in 
addition that word can now be fed into a function and depending on 
outcome be fed back into the machinery


(there are trackers that give insight in the process)

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 not modules then modules = { } end modules ['lang-rep'] = {
version   = 1.001,
comment   = "companion to lang-rep.mkiv",
author= "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE / ConTeXt Development Team",
license   = "see context related readme files"
}

-- A BachoTeX 2013 experiment, probably not that useful. Eventually I used a 
simpler
-- more generic example. I'm sure no one ever notices of even needs this code.
--
-- As a follow up on a question by Alan about special treatment of dropped caps 
I wonder
-- if I can make this one more clever (probably in a few more dev steps). For 
instance
-- injecting nodes or replacing nodes. It's a prelude to a kind of lpeg for 
nodes,
-- although (given experiences so far) we don't really need that. After all, 
each problem
-- is somewhat unique.

local type, tonumber, next = type, tonumber, next
local gmatch, gsub = string.gmatch, string.gsub
local utfbyte, utfsplit = utf.byte, utf.split
local P, C, U, Cc, Ct, Cs, lpegmatch = lpeg.P, lpeg.C, 
lpeg.patterns.utf8character, lpeg.Cc, lpeg.Ct, lpeg.Cs, lpeg.match
local find = string.find

local zwnj =  0x200C
local grouped  = P("{") * ( Ct((U/utfbyte-P("}"))^1) + Cc(false) ) * P("}")-- 
grouped
local splitter = Ct((
#P("{") * (
P("{}") / function() return zwnj end
  + Ct(Cc("discretionary") * grouped * grouped * grouped)
  + Ct(Cc("noligature")* grouped)
)
  + U/utfbyte
)^1)

local stripper = P("{") * Cs((1-P(-2))^0) * P("}") * P(-1)

local trace_replacements = false  trackers.register("languages.replacements",   
  function(v) trace_replacements = v end)
local trace_details  = false  
trackers.register("languages.replacements.details", function(v) trace_details   
   = v end)

local report_replacement = logs.reporter("languages","replacements")

local glyph_code = nodes.nodecodes.glyph
local glue_code  = nodes.nodecodes.glue

local spaceskip_code = nodes.gluecodes.spaceskip
local xspaceskip_code= nodes.gluecodes.xspaceskip

local nuts   = nodes.nuts

local getnext= nuts.getnext
local getprev= nuts.getprev
local getattr= nuts.getattr
local getid  = nuts.getid
local getsubtype = nuts.getsubtype
local getchar= nuts.getchar
local isglyph= nuts.isglyph

local setlink= nuts.setlink
local setnext= nuts.setnex

Re: [NTG-context] ligature exceptions

2017-10-08 Thread Pablo Rodriguez
On 10/08/2017 02:54 PM, Henning Hraban Ramm wrote:
> Am 2017-10-08 um 10:37 schrieb Pablo Rodriguez:
>> On 10/08/2017 12:22 AM, Hans Hagen wrote:
>> Many thanks for your reply, Hans.
>>
>> I almost get it all ;-), but what is the "i" variable?
> 
> It defines the kerning between f and i. I also added "f" and "b".

Many thanks for the replies, both Hans and Hraban.

I didn’t notice any change in my sample because I only tested the fl pair.

Many thanks for your help,

Pablo
-- 
http://www.ousia.tk
___
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] ligature exceptions

2017-10-08 Thread Henning Hraban Ramm
Am 2017-10-08 um 10:37 schrieb Pablo Rodriguez :

> On 10/08/2017 12:22 AM, Hans Hagen wrote:
>> You need to define features before fonts get defined because we share 
>> font definitions and their features as much as possible
>> 
>> \startluacode
>> fonts.handlers.otf.addfeature {
>> name = "kernligatures",
>> type = "kern",
>> data = {
>> f = { i = 50, l = 50 },
>> }
>> }
>> \stopluacode
> 
> Many thanks for your reply, Hans.
> 
> I almost get it all ;-), but what is the "i" variable?

It defines the kerning between f and i. I also added "f" and "b".

And after playing with the values and setting up exceptions I understand now 
why Hans hates the Alegreya font(s):
While the kerning works, the font still uses the long-arced f (that is meant 
for creating ligatures).

I still like the design, but will consider different fonts for upcoming books.


Greetlings, Hraban
---
http://www.fiee.net
http://wiki.contextgarden.net
GPG Key ID 1C9B22FD

___
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] ligature exceptions

2017-10-08 Thread Henning Hraban Ramm
Am 2017-10-08 um 00:22 schrieb Hans Hagen :

> On 10/7/2017 9:21 PM, Pablo Rodriguez wrote:
> You need to define features before fonts get defined because we share font 
> definitions and their features as much as possible
> 
> \startluacode
>fonts.handlers.otf.addfeature {
>name = "kernligatures",
>type = "kern",
>data = {
>f = { i = 50, l = 50 },
>}
>}
> \stopluacode
> 
> \blockligatures[u:fl:a]
> 
> Now we can use them
> 
> \definefontfamily[mainfont][rm][Brill]
> \definefontfamily[mainfont][tt][Dejavu]
> 
> \setupbodyfont[mainfont]
> 
> \definefontfeature[default:b][default][blockligatures=yes]
> \definefontfeature[default:k][default][blockligatures=yes,kernligatures=yes]

Thank you very much, that helps! I’m working on a set of exceptions...



Greetlings, Hraban
---
http://www.fiee.net
http://wiki.contextgarden.net
GPG Key ID 1C9B22FD

___
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] ligature exceptions

2017-10-08 Thread Henning Hraban Ramm
Am 2017-10-08 um 00:14 schrieb Hans Hagen :

> On 10/7/2017 9:21 PM, Pablo Rodriguez wrote:
>> On 10/07/2017 01:25 PM, Henning Hraban Ramm wrote:
>>> I rejoiced too early:
>>> While the ligature exception handling works with some of the default
>>> fonts (lm, termes, pagella), it fails with the Alegreya fonts that I’m
>>> using.
> 
> forget about Algreya as it's a useless font ... it has no kerns, no 
> ligatures, no features at all so the f an whatever follows will always touch 
> or overlap due to the design

I can’t agree - it’s beautifully designed, and I can’t complain about its 
kerning. It also responds to tlig or liga features, even if they’re implemented 
as single (i.e. not ligature) glyphs (there are e.g. different f glyphs). Maybe 
it’s set up in a strange way, but I don’t think it’s that bad. Of course I 
don’t have your level of insight.

My problem with Alegreya’s *design* it just that it’s not very well suited for 
digital printing, it needs a high resolution to look good.

Greetlings, Hraban
---
http://www.fiee.net
http://wiki.contextgarden.net
GPG Key ID 1C9B22FD

___
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] ligature exceptions

2017-10-08 Thread Pablo Rodriguez
On 10/08/2017 12:22 AM, Hans Hagen wrote:
> You need to define features before fonts get defined because we share 
> font definitions and their features as much as possible
> 
> \startluacode
>  fonts.handlers.otf.addfeature {
>  name = "kernligatures",
>  type = "kern",
>  data = {
>  f = { i = 50, l = 50 },
>  }
>  }
> \stopluacode

Many thanks for your reply, Hans.

I almost get it all ;-), but what is the "i" variable?

Setting different values or even removing doesn’t make any difference
(at least, that I notice).

Many thanks for your help again,

Pablo
-- 
http://www.ousia.tk
___
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] ligature exceptions

2017-10-07 Thread Pablo Rodriguez
On 10/08/2017 12:14 AM, Hans Hagen wrote:
> On 10/7/2017 9:21 PM, Pablo Rodriguez wrote:
> [...]
> forget about Algreya as it's a useless font ... it has no kerns, no 
> ligatures, no features at all so the f an whatever follows will always 
> touch or overlap due to the design

In fact, the full version is a commercial typeface:
https://www.myfonts.com/fonts/huertatipografica/alegreya-ht-pro/.

I wonder whether it makes sense to have a free font that only contains
the shapes and just nothing more.

Pablo
-- 
http://www.ousia.tk
___
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] ligature exceptions

2017-10-07 Thread Hans Hagen

On 10/7/2017 9:21 PM, Pablo Rodriguez wrote:


The Brill fonts don’t work either (http://www.brill.com/about/brill-fonts).

 \definefontfamily[mainfont][rm][Alegreya]
 \definefontfamily[otherfont][rm][Brill]
 \setupbodyfont [mainfont,16pt]

 \starttext
 \startTEXpage[offset=1em]
 \startbuffer
 falsch: Auflage Kampffront

 richtig: Au\noligature{fl}age Kamp\noligature{ff}ront

 \setreplacements[eka]
 richtig: Auflage Kampffront

 f ft fl fk fb ff

 f f\/t f\/l f\/k f\/b f\/f
 \resetreplacements
 \stopbuffer

 \getbuffer

 \setupbodyfont[times]\getbuffer

 \setupbodyfont[otherfont]\getbuffer
 \stopTEXpage
 \stoptext
You need to define features before fonts get defined because we share 
font definitions and their features as much as possible


\startluacode
fonts.handlers.otf.addfeature {
name = "kernligatures",
type = "kern",
data = {
f = { i = 50, l = 50 },
}
}
\stopluacode

\blockligatures[u:fl:a]

Now we can use them

\definefontfamily[mainfont][rm][Brill]
\definefontfamily[mainfont][tt][Dejavu]

\setupbodyfont[mainfont]

\definefontfeature[default:b][default][blockligatures=yes]
\definefontfeature[default:k][default][blockligatures=yes,kernligatures=yes]

\showfontkerns

\starttext

{\definedfont[Serif*default   @ 11pt]auflage}\par
{\definedfont[Serif*default:b @ 11pt]auflage}\par
{\definedfont[Serif*default:k @ 11pt]auflage}\par

\stoptext

so, you need to add a kern too because brill assumes ligatures to be applied

as usual with tex .. there's always a way out but not always a trivial 
one and of course all this gets forgotten and/or lost in the flood of 
solutions


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] ligature exceptions

2017-10-07 Thread Hans Hagen

On 10/7/2017 9:21 PM, Pablo Rodriguez wrote:

On 10/07/2017 01:25 PM, Henning Hraban Ramm wrote:

I rejoiced too early:
While the ligature exception handling works with some of the default
fonts (lm, termes, pagella), it fails with the Alegreya fonts that I’m
using.


forget about Algreya as it's a useless font ... it has no kerns, no 
ligatures, no features at all so the f an whatever follows will always 
touch or overlap due to the design


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] ligature exceptions

2017-10-07 Thread Henning Hraban Ramm
Am 2017-10-07 um 21:21 schrieb Pablo Rodriguez :

> Both Alegreya and Brill don’t replace the ligature with a single glyph,
> but replace the first glyph (only, as far as I know).
> 
> I don’t know which is the way to solve it, but this might be the cause.

Oh, yes. Thanks for the analysis. I get the startligature-f also on 
hyphenation, like in auf-fällig, so that the arc of the first f (that is 
supposed to touch the second) reaches over the hyphen.


Greetlings, Hraban
---
http://www.fiee.net
http://wiki.contextgarden.net
GPG Key ID 1C9B22FD

___
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] ligature exceptions

2017-10-07 Thread Pablo Rodriguez
On 10/07/2017 01:25 PM, Henning Hraban Ramm wrote:
> I rejoiced too early:
> While the ligature exception handling works with some of the default
> fonts (lm, termes, pagella), it fails with the Alegreya fonts that I’m
> using.

The Brill fonts don’t work either (http://www.brill.com/about/brill-fonts).

\definefontfamily[mainfont][rm][Alegreya]
\definefontfamily[otherfont][rm][Brill]
\setupbodyfont [mainfont,16pt]

\starttext
\startTEXpage[offset=1em]
\startbuffer
falsch: Auflage Kampffront

richtig: Au\noligature{fl}age Kamp\noligature{ff}ront

\setreplacements[eka]
richtig: Auflage Kampffront

f ft fl fk fb ff

f f\/t f\/l f\/k f\/b f\/f
\resetreplacements
\stopbuffer

\getbuffer

\setupbodyfont[times]\getbuffer

\setupbodyfont[otherfont]\getbuffer
\stopTEXpage
\stoptext

Both Alegreya and Brill don’t replace the ligature with a single glyph,
but replace the first glyph (only, as far as I know).

I don’t know which is the way to solve it, but this might be the cause.

Just in case it helps,

Pablo
-- 
http://www.ousia.tk
___
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] ligature exceptions

2017-10-07 Thread Henning Hraban Ramm
I rejoiced too early:
While the ligature exception handling works with some of the default fonts (lm, 
termes, pagella), it fails with the Alegreya fonts that I’m using.
I’d be glad if someone (you?) could look into my attached typescript file or 
even try downloading the fonts* to check what’s going on.

*) 
https://fonts.google.com/?selection.family=Alegreya|Alegreya+SC|Alegreya+Sans|Alegreya+Sans+SC

\mainlanguage[de]

%\usetypescriptfile [type-alegreya]
%\usetypescript [alegreya-light]
%\setupbodyfont [alegreya,rm,16pt]
\setupbodyfont  [termes,rm,16pt]

\definefontfeature[default]
[mode=node,kern=yes,
liga=yes,tlig=yes,
ccmp=yes,language=dflt,
protrusion=quality,
expansion=quality]

\replaceword[eka][Auflage][Au{fl}age]
\replaceword[eka][Kampffront][Kamp{ff}ront]

\starttext
falsch: Auflage Kampffront

richtig: Au\noligature{fl}age Kamp\noligature{ff}ront

\setreplacements[eka]
richtig: Auflage Kampffront
\stoptext



Greetlings, Hraban
---
http://www.fiee.net
http://wiki.contextgarden.net
GPG Key ID 1C9B22FD


type-alegreya.tex
Description: Binary data
___
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] ligature exceptions

2017-09-28 Thread Pablo Rodriguez
On 09/28/2017 03:54 PM, Hans Hagen wrote:
> On 9/28/2017 1:51 PM, Pablo Rodriguez wrote:
>> [...]
>> I overlooked that \blockligatures[u:fl:age, u:fl:eg] only works if there
>> is also a \blockligatures[fl].
>>
>> Hans, is this a bug or is it intended?
> do you indeed use the latest beta? anyway, the \replaceword mechanism is 
> a bit more flexible and efficient

Hans,

after updating to latest beta (from 2017.09.25 19:19 to 2017.09.28 10:07
[I didn’t realize that there was a newer beta yesterday]), it works.

Just in case it may be relevant, \blockligatures[u:fl:age] blocks
ligatures in auflegt and Aufl.

Minimal sample:

\starttext
\blockligatures[u:fl:age]

\definefontfeature[default:b][default][blockligatures=yes]

\setupbodyfont[times]\showfontkerns

\startTEXpage[offset=1em]
fl Auflage auflegt Aufl.

\definedfont[Serif*default:b]
fl Auflage auflegt Aufl.
\stopTEXpage
\stoptext

Pablo
-- 
http://www.ousia.tk
___
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] ligature exceptions

2017-09-28 Thread Hans Hagen

On 9/28/2017 1:51 PM, Pablo Rodriguez wrote:

On 09/28/2017 09:17 AM, Herbert Voss wrote:

Am 28.09.2017 um 08:40 schrieb Pablo Rodriguez:


using latest beta (from 2017.09.25 19:19), the following sample works:

[...]
How do you catch "Aufl." (the abbreviation of Auflage),
   which is written _with_ a ligature?


Herbert,

I overlooked that \blockligatures[u:fl:age, u:fl:eg] only works if there
is also a \blockligatures[fl].

Hans, is this a bug or is it intended?
do you indeed use the latest beta? anyway, the \replaceword mechanism is 
a bit more flexible and efficient


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] ligature exceptions

2017-09-28 Thread Pablo Rodriguez
On 09/28/2017 09:17 AM, Herbert Voss wrote:
> Am 28.09.2017 um 08:40 schrieb Pablo Rodriguez:
> 
>> using latest beta (from 2017.09.25 19:19), the following sample works:
> [...]
> How do you catch "Aufl." (the abbreviation of Auflage),
>   which is written _with_ a ligature?

Herbert,

I overlooked that \blockligatures[u:fl:age, u:fl:eg] only works if there
is also a \blockligatures[fl].

Hans, is this a bug or is it intended?

Pablo
-- 
http://www.ousia.tk
___
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] ligature exceptions

2017-09-28 Thread Henning Hraban Ramm
Am 2017-09-27 um 23:02 schrieb Herbert Voss :

>> Thank you for the suggestion.
>> I tried
>> \replaceword[eka][Auflage][Au{fl}age]
>> \setreplacements[eka]
>> and even converted the german wordlist from the selnolig package, but it 
>> doesn’t help.
>> If I try
>> \replaceword[eka][Auflage][Au\noligature{fl}age]
>> I get a literal "Au noligature fl age" in my text.
>> Simply Au\noligature{fl}age doesn’t help either.
>> My active features are:
>> \definefontfeature[default]
>> [mode=node,liga=yes,kern=yes,tlig=yes,
>> ccmp=yes,language=dflt,
>> protrusion=quality,
>> expansion=quality]
> 
> \definefontfeature[default]
> [mode=node,liga=yes,kern=yes,tlig=yes,
> ccmp=yes,language=dflt,
> protrusion=quality,
> expansion=quality]
> 
> \replaceword[eka][Auflage][Au{fl}age]
> 
> \starttext
> Auflage
> Au\noligature{fl}age
> \setreplacements[eka]
> Auflage
> \stoptext
> 
> 
> no problem here, first with ligature the other two without

Yes, today it works. Thank you! Didn’t change anything. Strange.

Greetlings, Hraban
---
http://www.fiee.net
http://wiki.contextgarden.net
GPG Key ID 1C9B22FD

___
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] ligature exceptions

2017-09-28 Thread Herbert Voss

Am 28.09.2017 um 08:40 schrieb Pablo Rodriguez:


using latest beta (from 2017.09.25 19:19), the following sample works:

 \starttext
 \blockligatures[fi,ff] \blockligatures[fl]
 \blockligatures[u:fl:age, u:fl:eg]

 \definefontfeature[default:b][default][blockligatures=yes]

 \setupbodyfont[times]\showfontkerns

 \startTEXpage[offset=1em]
 fi ff fl Auflage auflegt

 \definedfont[Serif*default:b]
 fi ff fl Auflage auflegt


How do you catch "Aufl." (the abbreviation of Auflage),
 which is written _with_ a ligature?

Herbert




 \stopTEXpage
 \stoptext

Just in case it helps,

Pablo



___
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] ligature exceptions

2017-09-27 Thread Pablo Rodriguez
On 09/27/2017 10:27 PM, Henning Hraban Ramm wrote:
> Am 2017-09-27 um 18:13 schrieb Hans Hagen :
>> [...]
>> The \blockligatures[u:fl:age] is new and something of a joke
>> experiment ... I can probably come up with a real advanced and robust
>> mechanism if motivated enough
> 
> Thank you, I tried it, and while blocking ligatures generally works
> (\blockligatures[fl]), the selective blocking
> (\blockligatures[u:fl:age]) doesn’t change anything.
> Do you have this only in your local version?

Hi Hraban,

using latest beta (from 2017.09.25 19:19), the following sample works:

\starttext
\blockligatures[fi,ff] \blockligatures[fl]
\blockligatures[u:fl:age, u:fl:eg]

\definefontfeature[default:b][default][blockligatures=yes]

\setupbodyfont[times]\showfontkerns

\startTEXpage[offset=1em]
fi ff fl Auflage auflegt

\definedfont[Serif*default:b]
fi ff fl Auflage auflegt
\stopTEXpage
\stoptext

Just in case it helps,

Pablo
-- 
http://www.ousia.tk
___
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] ligature exceptions

2017-09-27 Thread Hans Hagen

On 9/27/2017 11:08 PM, Thomas A. Schmitz wrote:

On 09/27/2017 10:25 PM, Henning Hraban Ramm wrote:

Thank you for the suggestion.
I tried

\replaceword[eka][Auflage][Au{fl}age]
\setreplacements[eka]

and even converted the german wordlist from the selnolig package, but 
it doesn’t help.



Works here. You'll have to make a real example.

I'll add an extra (simple) definition format:

\replaceword [eka] [Au{fl}age Shiff{f}ahrt]

I leave it to others to collect (reasonable) lists of words. We can 
these to the distribution then.


-
  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] ligature exceptions

2017-09-27 Thread Thomas A. Schmitz

On 09/27/2017 10:25 PM, Henning Hraban Ramm wrote:

Thank you for the suggestion.
I tried

\replaceword[eka][Auflage][Au{fl}age]
\setreplacements[eka]

and even converted the german wordlist from the selnolig package, but it 
doesn’t help.



Works here. You'll have to make a real example.

Thomas
___
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] ligature exceptions

2017-09-27 Thread Herbert Voss

Am 27.09.2017 um 22:25 schrieb Henning Hraban Ramm:

Am 2017-09-27 um 15:39 schrieb Thomas A. Schmitz :


On 09/27/2017 02:16 PM, Thomas Widmann wrote:

That's a nice idea.  If something like that existed, it could be used
to change 's' to 'ſ' in relevant places, too.


This exists, see here: 
https://www.mail-archive.com/ntg-context@ntg.nl/msg79381.html


Thank you for the suggestion.
I tried

\replaceword[eka][Auflage][Au{fl}age]
\setreplacements[eka]

and even converted the german wordlist from the selnolig package, but it 
doesn’t help.
If I try
\replaceword[eka][Auflage][Au\noligature{fl}age]
I get a literal "Au noligature fl age" in my text.

Simply Au\noligature{fl}age doesn’t help either.

My active features are:
\definefontfeature[default]
 [mode=node,liga=yes,kern=yes,tlig=yes,
 ccmp=yes,language=dflt,
 protrusion=quality,
 expansion=quality]



\definefontfeature[default]
[mode=node,liga=yes,kern=yes,tlig=yes,
ccmp=yes,language=dflt,
protrusion=quality,
expansion=quality]

\replaceword[eka][Auflage][Au{fl}age]

\starttext
Auflage
Au\noligature{fl}age
\setreplacements[eka]
Auflage
\stoptext


no problem here, first with ligature the other two without

Herbert





Greetlings, Hraban
---
http://www.fiee.net
http://wiki.contextgarden.net
GPG Key ID 1C9B22FD


___
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
___



___
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] ligature exceptions

2017-09-27 Thread Henning Hraban Ramm
Am 2017-09-27 um 18:13 schrieb Hans Hagen :

> Anyway, in addition to Thomas answer ... we already have this
> 
> \blockligatures[fi,ff] \blockligatures[fl]
> \blockligatures[u:fl:age]
> 
> \definefontfeature[default:nolig][default][blockligatures=yes]
> 
> \startTEXpage[offset=1em]
>\definedfont[Serif*default:nolig]
>fi ff fl auflage
>\definedfont[Serif*default]
>fi ff fl auflage
> \stopTEXpage
> 
> The \blockligatures[u:fl:age] is new and something of a joke experiment ... I 
> can probably come up with a real advanced and robust mechanism if motivated 
> enough

Thank you, I tried it, and while blocking ligatures generally works 
(\blockligatures[fl]), the selective blocking (\blockligatures[u:fl:age]) 
doesn’t change anything.
Do you have this only in your local version?

Greetlings, Hraban
---
http://www.fiee.net
http://wiki.contextgarden.net
GPG Key ID 1C9B22FD

___
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] ligature exceptions

2017-09-27 Thread Henning Hraban Ramm
Am 2017-09-27 um 15:39 schrieb Thomas A. Schmitz :

> On 09/27/2017 02:16 PM, Thomas Widmann wrote:
>> That's a nice idea.  If something like that existed, it could be used
>> to change 's' to 'ſ' in relevant places, too.
> 
> This exists, see here: 
> https://www.mail-archive.com/ntg-context@ntg.nl/msg79381.html

Thank you for the suggestion.
I tried

\replaceword[eka][Auflage][Au{fl}age]
\setreplacements[eka]

and even converted the german wordlist from the selnolig package, but it 
doesn’t help.
If I try
\replaceword[eka][Auflage][Au\noligature{fl}age]
I get a literal "Au noligature fl age" in my text.

Simply Au\noligature{fl}age doesn’t help either.

My active features are:
\definefontfeature[default]
[mode=node,liga=yes,kern=yes,tlig=yes,
ccmp=yes,language=dflt,
protrusion=quality,
expansion=quality]


Greetlings, Hraban
---
http://www.fiee.net
http://wiki.contextgarden.net
GPG Key ID 1C9B22FD


___
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] ligature exceptions

2017-09-27 Thread Herbert Voss

Am 27.09.2017 um 14:09 schrieb Henning Hraban Ramm:



I know I can break ligatures with \/, like Auf\/lage, but is there a general 
dictionary approach, like \hyphenation{} ?


https://ctan.org/tex-archive/macros/luatex/latex/selnolig

is a selnolig.lua which could be used for a solution with context.
A list of all german words where a ligature should be suppressed
is also there.

Herbert





Greetlings, Hraban
---
http://www.fiee.net
http://wiki.contextgarden.net
GPG Key ID 1C9B22FD

___
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
___



___
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] ligature exceptions

2017-09-27 Thread Hans Hagen

On 9/27/2017 5:53 PM, Ulrike Fischer wrote:

Am Wed, 27 Sep 2017 15:10:33 +0200 schrieb Tomas Hala:


 From this point of view, Auf{}lage seems better.


This doesn't prevent the ligature:

\starttext

Auflage Auf{}lage Auf\/lage

\stoptext

This also documented: "The most important change is that adding a
brace group in the middle of a word (like in of{}fice) does not
prevent ligature creation."

With pdftex it does avoid ligatures, but not reliably. There are
cases where the brace group disappear when pdftex tries out
hyphenation points.
in traditional tex hyphenation is integrated in the par builder which 
comes after ligaturing and kerning and tex only hyphenated where it 
'makes sense' and in the process (multi-pass, going into disc nodes) it 
will consult (deconstruct / reconstruct) ligatures and at that point 
it's not known that the input had a {}. Tricks like inserting something 
in between is also unreliable when done at the wrong time and it can 
also prevent for instance kerns of hyphenation.


Anyway, in addition to Thomas answer ... we already have this

\blockligatures[fi,ff] \blockligatures[fl]
\blockligatures[u:fl:age]

\definefontfeature[default:nolig][default][blockligatures=yes]

\startTEXpage[offset=1em]
\definedfont[Serif*default:nolig]
fi ff fl auflage
\definedfont[Serif*default]
fi ff fl auflage
\stopTEXpage

The \blockligatures[u:fl:age] is new and something of a joke experiment 
... I can probably come up with a real advanced and robust mechanism if 
motivated enough


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] ligature exceptions

2017-09-27 Thread Ulrike Fischer
Am Wed, 27 Sep 2017 15:10:33 +0200 schrieb Tomas Hala:

> From this point of view, Auf{}lage seems better.

This doesn't prevent the ligature:

\starttext

Auflage Auf{}lage Auf\/lage 

\stoptext

This also documented: "The most important change is that adding a
brace group in the middle of a word (like in of{}fice) does not
prevent ligature creation."

With pdftex it does avoid ligatures, but not reliably. There are
cases where the brace group disappear when pdftex tries out
hyphenation points. 



-- 
Ulrike Fischer 
http://www.troubleshooting-tex.de/

___
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] ligature exceptions

2017-09-27 Thread Florian Grammel
There is a LuaLaTeX-package "selnolig" to achieve this goal. Its wordlists and 
rules could probably be adapted. There is also a thorough discussion of this 
challenge in the documentation.
https://www.ctan.org/pkg/selnolig

Best regards,
Florian



Florian Grammel

Copenhagen, Denmark

___
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] ligature exceptions

2017-09-27 Thread Thomas A. Schmitz

On 09/27/2017 02:16 PM, Thomas Widmann wrote:

That's a nice idea.  If something like that existed, it could be used
to change 's' to 'ſ' in relevant places, too.



This exists, see here: 
https://www.mail-archive.com/ntg-context@ntg.nl/msg79381.html

___
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] ligature exceptions

2017-09-27 Thread Tomas Hala
Hi Hraban,

I am afraid that \/ will break not only the ligature but moreover
it will erase the possible breakpoint between f and l. 
From this point of view, Auf{}lage seems better.

General approach might be connected with font some features as Hans
shown at ConTeXt Meeting this year. 

I recorded this case into the list of things we have to keep in mind 
for testing of free fonts.

Best wishes,

Tomas

Wed, Sep 27, 2017 ve 02:09:50PM +0200 Henning Hraban Ramm napsal(a):
# Hi all,
# 
# I know I can break ligatures with \/, like Auf\/lage, but is there a general 
dictionary approach, like \hyphenation{} ?
# 
# 
# Greetlings, Hraban
# ---
# http://www.fiee.net
# http://wiki.contextgarden.net
# GPG Key ID 1C9B22FD
# 
# 
___
# 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
# 
___

 Tomáš Hála

Mendelova univerzita, Provozně ekonomická fakulta, ústav informatiky
Zemědělská 1, CZ-613 00 Brno,  tel. +420 545 13 22 28

http://akela.mendelu.cz/~thala
___
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] ligature exceptions

2017-09-27 Thread Thomas Widmann
On 27 September 2017 at 13:09, Henning Hraban Ramm  wrote:
>
> I know I can break ligatures with \/, like Auf\/lage, but is there a general
> dictionary approach, like \hyphenation{} ?

That's a nice idea.  If something like that existed, it could be used
to change 's' to 'ſ' in relevant places, too.

Thomas
-- 
Thomas Widmann
Director
Complexli Limited
+44 789 444 3009
___
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
___