ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Adjust kerning with superscript
@ 2019-04-15  7:50 Henri Menke
  2019-04-15  9:06 ` Hans Hagen
  0 siblings, 1 reply; 4+ messages in thread
From: Henri Menke @ 2019-04-15  7:50 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Dear list,

I am unhappy with how some fonts kern particular subscripts.  For example in
the default Latin Modern, subscripts to the Greek capital gamma could use some
negative kerning.  Because I can't (and don't want to) fix the font, I thought
that I could patch the font on-the-fly in ConTeXt.

The usual approach with fonts.handlers.otf.addfeature works well in math mode,
but does not extend into subscripts (MWE below).  Is there a method to adjust
subscript kernings?  Could this be done using mathkerns?  Latin Modern doesn't
have any but maybe they can be added on the fly.

Cheers, Henri

---

\startluacode
fonts.handlers.otf.addfeature {
    type = "kern",
    name = "kern",
    data = { [0x0393] = { [0x0030] = -200 } }
}
\stopluacode

\setupbodyfont[modern]

\starttext
$\Gamma0$ % works fine :)

$\Gamma_0$ % doesn't work :(
\stoptext

___________________________________________________________________________________
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] 4+ messages in thread

* Re: Adjust kerning with superscript
  2019-04-15  7:50 Adjust kerning with superscript Henri Menke
@ 2019-04-15  9:06 ` Hans Hagen
  2019-04-15  9:23   ` Henri Menke
  0 siblings, 1 reply; 4+ messages in thread
From: Hans Hagen @ 2019-04-15  9:06 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 4/15/2019 9:50 AM, Henri Menke wrote:
> Dear list,
> 
> I am unhappy with how some fonts kern particular subscripts.  For example in
> the default Latin Modern, subscripts to the Greek capital gamma could use some
> negative kerning.  Because I can't (and don't want to) fix the font, I thought
> that I could patch the font on-the-fly in ConTeXt.
> 
> The usual approach with fonts.handlers.otf.addfeature works well in math mode,
> but does not extend into subscripts (MWE below).  Is there a method to adjust
> subscript kernings?  Could this be done using mathkerns?  Latin Modern doesn't
> have any but maybe they can be added on the fly.
> 
> Cheers, Henri
> 
> ---
> 
> \startluacode
> fonts.handlers.otf.addfeature {
>      type = "kern",
>      name = "kern",
>      data = { [0x0393] = { [0x0030] = -200 } }
> }
> \stopluacode
> 
> \setupbodyfont[modern]
> 
> \starttext
> $\Gamma0$ % works fine :)
> 
> $\Gamma_0$ % doesn't work :(
> \stoptext
see pagella-math.lfg


-----------------------------------------------------------------
                                           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] 4+ messages in thread

* Re: Adjust kerning with superscript
  2019-04-15  9:06 ` Hans Hagen
@ 2019-04-15  9:23   ` Henri Menke
  2019-04-15  9:48     ` Hans Hagen
  0 siblings, 1 reply; 4+ messages in thread
From: Henri Menke @ 2019-04-15  9:23 UTC (permalink / raw)
  To: ntg-context



On 15/04/19 9:06 PM, Hans Hagen wrote:
> On 4/15/2019 9:50 AM, Henri Menke wrote:
>> Dear list,
>>
>> I am unhappy with how some fonts kern particular subscripts.  For example in
>> the default Latin Modern, subscripts to the Greek capital gamma could use some
>> negative kerning.  Because I can't (and don't want to) fix the font, I thought
>> that I could patch the font on-the-fly in ConTeXt.
>>
>> The usual approach with fonts.handlers.otf.addfeature works well in math mode,
>> but does not extend into subscripts (MWE below).  Is there a method to adjust
>> subscript kernings?  Could this be done using mathkerns?  Latin Modern doesn't
>> have any but maybe they can be added on the fly.
>>
>> Cheers, Henri
>>
>> ---
>>
>> \startluacode
>> fonts.handlers.otf.addfeature {
>>      type = "kern",
>>      name = "kern",
>>      data = { [0x0393] = { [0x0030] = -200 } }
>> }
>> \stopluacode
>>
>> \setupbodyfont[modern]
>>
>> \starttext
>> $\Gamma0$ % works fine :)
>>
>> $\Gamma_0$ % doesn't work :(
>> \stoptext
> see pagella-math.lfg

Thanks for the hint.  Is there a possibility to do this without goodies?  They
are not available in generic.

Cheers, Henri

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

___________________________________________________________________________________
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] 4+ messages in thread

* Re: Adjust kerning with superscript
  2019-04-15  9:23   ` Henri Menke
@ 2019-04-15  9:48     ` Hans Hagen
  0 siblings, 0 replies; 4+ messages in thread
From: Hans Hagen @ 2019-04-15  9:48 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 4/15/2019 11:23 AM, Henri Menke wrote:
> 
> 
> On 15/04/19 9:06 PM, Hans Hagen wrote:
>> On 4/15/2019 9:50 AM, Henri Menke wrote:
>>> Dear list,
>>>
>>> I am unhappy with how some fonts kern particular subscripts.  For example in
>>> the default Latin Modern, subscripts to the Greek capital gamma could use some
>>> negative kerning.  Because I can't (and don't want to) fix the font, I thought
>>> that I could patch the font on-the-fly in ConTeXt.
>>>
>>> The usual approach with fonts.handlers.otf.addfeature works well in math mode,
>>> but does not extend into subscripts (MWE below).  Is there a method to adjust
>>> subscript kernings?  Could this be done using mathkerns?  Latin Modern doesn't
>>> have any but maybe they can be added on the fly.
>>>
>>> Cheers, Henri
>>>
>>> ---
>>>
>>> \startluacode
>>> fonts.handlers.otf.addfeature {
>>>       type = "kern",
>>>       name = "kern",
>>>       data = { [0x0393] = { [0x0030] = -200 } }
>>> }
>>> \stopluacode
>>>
>>> \setupbodyfont[modern]
>>>
>>> \starttext
>>> $\Gamma0$ % works fine :)
>>>
>>> $\Gamma_0$ % doesn't work :(
>>> \stoptext
>> see pagella-math.lfg
> 
> Thanks for the hint.  Is there a possibility to do this without goodies?  They
> are not available in generic.

i suppose that you can use one of the hooks that adapt fonts beforehand: 
just add features after the font gets loaded but before it gets passed 
to tex (it's character.mathkerns)

(at some point i'll probably add such stacked kern definitions in 
context but it depends on how the gyre fonts evolve)

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] 4+ messages in thread

end of thread, other threads:[~2019-04-15  9:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-15  7:50 Adjust kerning with superscript Henri Menke
2019-04-15  9:06 ` Hans Hagen
2019-04-15  9:23   ` Henri Menke
2019-04-15  9:48     ` Hans Hagen

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).