Re: [NTG-context] disabling specific ligatures

2017-03-22 Thread Hans Hagen

On 3/21/2017 5:44 PM, Csikos Bela wrote:

Dear context users:

Is it possible to disable a specific ligature in a whole document in mkiv?
I would like to disable fi ligature.
Does it make a difference if I use a true type font installed on my
system?


normally that is done by setting a language feature in the font

you can also cook up a new feature, like

fonts.handlers.otf.addfeature {
name= "nofiligature1",
type= "chainsubstitution",
nocheck = true,
prepend = true,
lookups = {
{
type = "multiple",
data = {
["f"] = { "f", 0x200C },
 -- ["i"] = { "i" },
},
},
},
data = {
rules = {
{
 -- current = { { "f" }, { "i" } },
 -- lookups = { 1, 1 },
current = { { "f" } },
after   = { { "i" } },
lookups = { 1 },
},
},
}
}

fonts.handlers.otf.addfeature {
name= "nofiligature2",
type= "chainsubstitution",
nocheck = true,
append  = true,
lookups = {
{
type = "ligature",
data = {
["f"] = { "f", 0x200C },
},
},
 -- {
 -- type = "substitution",
 -- data = {
 -- ["i"] = "i"
 -- },
 -- },
},
data = {
rules = {
{
 -- current = { { "f" }, { 0x200C }, { "i" } },
 -- lookups = { 1, 2 },
current = { { "f" }, { 0x200C } },
after   = { { "i" } },
lookups = { 1 },
},
},
}
}

Here the two step approach is needed to make sure you get proper kerning 
(given that a font has it, e.g pagella has between fe but not between 
ffe so ...).


Anyway, I've added a helper to the upcoming so that it's a bit easier:

\blockligatures[fi,ff]
\blockligatures[fl]

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

\setupbodyfont[pagella]

The only thing you need to keep in mind is that the \blockligature 
commands have to come before fonts get defined (has to do with shared 
resources and optimizations and such) and of course that you need to

enable the feature.

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] disabling specific ligatures

2017-03-21 Thread Csikos Bela
Dear context users:

Is it possible to disable a specific ligature in a whole document in mkiv?
I would like to disable fi ligature.
Does it make a difference if I use a true type font installed on my
system?

Thank you in advance,

bcsikos
___
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] Disabling specific ligatures

2011-09-19 Thread Aditya Mahajan

On Sun, 18 Sep 2011, Wolfgang Schuster wrote:



Am 18.09.2011 um 03:13 schrieb Aditya Mahajan:


On Sun, 18 Sep 2011, Khaled Hosny wrote:


On Sat, Sep 17, 2011 at 08:02:43PM -0400, Aditya Mahajan wrote:

In MkII, one can disable ligatures by inserting {} at the
appropriate place. For example `self{}ish` disables the ligature
between f and i. What is the equivalent way to disable ligatures in
MkIV?


Inserting a empty box? self\null ish seems to work.


\null works but it disable hyphenation.


The Unicode way
would be inserting U+200C (ZWNJ)


Thank you. This works perfectly.


Actually it does not. The word cannot hypenate wher \zwnj is inserted.


When you don’t mind the extra space you can use “|*|”.


This works well. But why is the * discretionary defined to insert the 
extra 0.05em space? (I can overwrite it in my document, but I just curious 
about the reason for the original definition).


Aditya___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Disabling specific ligatures

2011-09-18 Thread Wolfgang Schuster

Am 18.09.2011 um 03:13 schrieb Aditya Mahajan:

 On Sun, 18 Sep 2011, Khaled Hosny wrote:
 
 On Sat, Sep 17, 2011 at 08:02:43PM -0400, Aditya Mahajan wrote:
 In MkII, one can disable ligatures by inserting {} at the
 appropriate place. For example `self{}ish` disables the ligature
 between f and i. What is the equivalent way to disable ligatures in
 MkIV?
 
 Inserting a empty box? self\null ish seems to work.
 
 \null works but it disable hyphenation.
 
 The Unicode way
 would be inserting U+200C (ZWNJ)
 
 Thank you. This works perfectly.

When you don’t mind the extra space you can use “|*|”.

Wolfgang
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


[NTG-context] Disabling specific ligatures

2011-09-17 Thread Aditya Mahajan
In MkII, one can disable ligatures by inserting {} at the appropriate 
place. For example `self{}ish` disables the ligature between f and i. What 
is the equivalent way to disable ligatures in MkIV?


Thanks,
Aditya
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Disabling specific ligatures

2011-09-17 Thread Khaled Hosny
On Sat, Sep 17, 2011 at 08:02:43PM -0400, Aditya Mahajan wrote:
 In MkII, one can disable ligatures by inserting {} at the
 appropriate place. For example `self{}ish` disables the ligature
 between f and i. What is the equivalent way to disable ligatures in
 MkIV?

Inserting a empty box? self\null ish seems to work. The Unicode way
would be inserting U+200C (ZWNJ)

\starttext
self{}ish\par
self\null ish\par
self\zwnj ish
\stoptext

Regards,
 Khaled

-- 
 Khaled Hosny
 Egyptian
 Arab
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Disabling specific ligatures

2011-09-17 Thread Aditya Mahajan

On Sun, 18 Sep 2011, Khaled Hosny wrote:


On Sat, Sep 17, 2011 at 08:02:43PM -0400, Aditya Mahajan wrote:

In MkII, one can disable ligatures by inserting {} at the
appropriate place. For example `self{}ish` disables the ligature
between f and i. What is the equivalent way to disable ligatures in
MkIV?


Inserting a empty box? self\null ish seems to work.


\null works but it disable hyphenation.


The Unicode way
would be inserting U+200C (ZWNJ)


Thank you. This works perfectly.

Aditya
___
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___