ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* disabling specific ligatures
@ 2017-03-21 16:44 Csikos Bela
  2017-03-22 11:04 ` Hans Hagen
  0 siblings, 1 reply; 7+ messages in thread
From: Csikos Bela @ 2017-03-21 16:44 UTC (permalink / raw)
  To: ntg-context

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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: disabling specific ligatures
  2017-03-21 16:44 disabling specific ligatures Csikos Bela
@ 2017-03-22 11:04 ` Hans Hagen
  0 siblings, 0 replies; 7+ messages in thread
From: Hans Hagen @ 2017-03-22 11:04 UTC (permalink / raw)
  To: ntg-context

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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Disabling specific ligatures
  2011-09-18  7:44     ` Wolfgang Schuster
@ 2011-09-19 14:30       ` Aditya Mahajan
  0 siblings, 0 replies; 7+ messages in thread
From: Aditya Mahajan @ 2011-09-19 14:30 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1001 bytes --]

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

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Disabling specific ligatures
  2011-09-18  1:13   ` Aditya Mahajan
@ 2011-09-18  7:44     ` Wolfgang Schuster
  2011-09-19 14:30       ` Aditya Mahajan
  0 siblings, 1 reply; 7+ messages in thread
From: Wolfgang Schuster @ 2011-09-18  7:44 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Disabling specific ligatures
  2011-09-18  0:50 ` Khaled Hosny
@ 2011-09-18  1:13   ` Aditya Mahajan
  2011-09-18  7:44     ` Wolfgang Schuster
  0 siblings, 1 reply; 7+ messages in thread
From: Aditya Mahajan @ 2011-09-18  1:13 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Disabling specific ligatures
  2011-09-18  0:02 Disabling " Aditya Mahajan
@ 2011-09-18  0:50 ` Khaled Hosny
  2011-09-18  1:13   ` Aditya Mahajan
  0 siblings, 1 reply; 7+ messages in thread
From: Khaled Hosny @ 2011-09-18  0:50 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Disabling specific ligatures
@ 2011-09-18  0:02 Aditya Mahajan
  2011-09-18  0:50 ` Khaled Hosny
  0 siblings, 1 reply; 7+ messages in thread
From: Aditya Mahajan @ 2011-09-18  0:02 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-03-22 11:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-21 16:44 disabling specific ligatures Csikos Bela
2017-03-22 11:04 ` Hans Hagen
  -- strict thread matches above, loose matches on Subject: below --
2011-09-18  0:02 Disabling " Aditya Mahajan
2011-09-18  0:50 ` Khaled Hosny
2011-09-18  1:13   ` Aditya Mahajan
2011-09-18  7:44     ` Wolfgang Schuster
2011-09-19 14:30       ` Aditya Mahajan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).