Fwd: ligature exceptions
Am 2017-09-28 um 01:16 schrieb 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.
Thank you very much, it works now. Here’s* the converted German wordlist from the selnolig package, still in the "old" single word syntax. I just \input it in my environment. I didn’t measure, but I don’t experience a delay - great! I’ll also add a wiki page about ligatures.** *) The message didn’t make it to the list on the first try, because the attachment was too big. It’s now at http://wiki.contextgarden.net/images/b/be/nolig-german-wordlist.tex **) http://wiki.contextgarden.net/Ligatures Greetlings, Hraban --- http://www.fiee.net http://wiki.contextgarden.net GPG Key ID 1C9B22FD
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
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
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
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 -----------------------------------------------------------------
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
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
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 -----------------------------------------------------------------
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
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
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
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
participants (3)
-
Hans Hagen
-
Henning Hraban Ramm
-
Pablo Rodriguez