[Not a bug] Selectively disabling ligatures
MarcinCiura opened this issue · 6 comments
I like the change to EB Garamond but the ubiquitous "st" ligature looks annoying in my Polish version. Since it took me a while to figure out how to disable it, I am leaving the snippet here in case anyone needs it, too.
\startluacode
require( "selnolig" )
function process_ligatures_wrapper(nodes,tail)
process_ligatures(nodes,tail)
return nodes
end
thirddata = thirddata or {}
thirddata.ligatures = {}
thirddata.ligatures.process_ligatures = process_ligatures_wrapper
nodes.tasks.appendaction(
"processors", "words", "thirddata.ligatures.process_ligatures" )
suppress_liga( "st", "s|t" )
\stopluacode
That was a sloppy work on EB Garamond typescript on my part (i have used a wrong name in one place 8214d73#diff-b44801cabf4c040d727c2524313832c6R446 ). Now you can simply choose which opentype features you want to see, like this: 8214d73#diff-b44801cabf4c040d727c2524313832c6R419 'hlig', for example, is responsible for strange-looking Historical Ligatures, like ct and st. They are now all turned off (more reasonable ones, like fl, fi, etc, are still in place). If some of these ligatures are still needed, I'll try to implement that separately. Is that OK?
And thank you for the snippet! I might be useful in the future.
Thank you for the quick reaction, Sergey! So this is why my attempts to set hlig=no
made no difference.
Your solution looks good even though I kind of liked "ct" and italic "sk" and "sp". However, as I understand the specimen of EB Garamond (https://github.com/georgd/EB-Garamond/tree/master/specimen), dlig=yes
was responsible only for the harmless "Th" ligature so I am not sure if it should be turned off.
Sure, dlig=yes
is ok, my mistake, i'll bring it back with the next commit. Would it be convenient for you if I put that typescript stuff in a separate file and \setupbodyfont ...
in the beginning of each language version, so you can keep your own variant, that works best for Polish, safe, when everything else is updated? (and maybe, it makes sense to do different typescripts for English and Russian anyway).
In newer versions of ConTeXt there seems to be a dedicated macro for blocking specific ligatures http://wiki.contextgarden.net/Ligatures#Blocking
It doesn't work on my distribution, though, but in the future this may become the easiest solution.
Hi, Sergey. Regarding the moving of \setupbodyfont
: thank you for proposing this idea. It would help me if not only \setupbodyfont
but also the commands for paper size and layout were separate for each language version. I probably will keep the B5 format and 11-point font.
Hi, Marcin. Typescript is now in a separate file, and size, layout and font declarations are now moved to main book file 43d14d0#diff-ce29b5befc0686b45157d97a74d17263R1