ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: "Mikael P. Sundqvist" <mickep@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Change kerning between math characters (prime and left parenthesis)
Date: Fri, 2 Jun 2017 17:08:40 +0200	[thread overview]
Message-ID: <CAHy-LL_j8KSF7CDzFHCYW2rbV8iwiao7Nw-W3rToG5z9t6XXZQ@mail.gmail.com> (raw)
In-Reply-To: <ea3810a3-e319-fa2e-5d1f-a0fb13e3ceed@wxs.nl>

On Fri, Jun 2, 2017 at 4:24 PM, Hans Hagen <pragma@wxs.nl> wrote:
> On 6/2/2017 10:59 AM, Mikael P. Sundqvist wrote:
>>
>> Hi!
>>
>> Now that the bug with primes is fixed in ConTeXt, I wonder if there is
>> a way to change the kerning between certain characters in mathematics
>> (in case one is not happy with the output from the font)? After
>> reading in fonts-mkiv.pdf this is what I came up with:
>
>
> you can also play withj:
>
> return {
>     name = "cambria-math",
>     mathematics = {
>        kerns = {
>           [0x1D453] = {
>               force = true,
>               topright = {
>                   {
>                       kern = 1000,
>                   },
>               },
>               bottomright = {
>                   {
>                       kern = 1000,
>                   },
>               },
>           },
>       },
>     },
> }
>
> currently you need to enable this:
>
> \enabledirectives[fontgoodies.mathkerning]
>
> keep in mind that some cambria (not all) have such staircase kerns which is
> why force is needed in order to overload
>
>> \startluacode
>> fonts.handlers.otf.addfeature {
>> name = "kerntest",
>> type = "kern",
>> data = {
>> [0x61] = { [0x62] = -150 }, -- a and b in text
>> [0x1d44e] = { [0x1d44f] = -150 }, -- mathematical italic small a and b
>> [0x02032] = { [0x00028] = -150 }, -- prime and left parenthesis
>> }
>> }
>> \stopluacode
>>
>> \definefontfeature[kerntest][kerntest=yes]
>>
>> \definefontfamily[lucidaopentype][rm][Lucida Bright OT]
>> \definefontfamily[lucidaopentype][mm][Lucida Bright Math OT]
>>
>> \setupbodyfont[lucidaopentype,10pt]
>>
>>
>> \startTEXpage[offset=3pt]
>> abba $abba f'(x)$
>>
>> \addff{kerntest}
>>
>> abba $abba f'(x)$
>>
>> I prefer $f'\mkern-3mu(x)$
>> \stopTEXpage
>>
>> The output is attached as a png file. As you see the kerning works as
>> expected in text mode, but not at all in math mode, even not for the a
>> and b (which I hope I entered correctly).
>>
>> Something like the third line is what I'm after, but not having to use
>> \mkern in all places. Is it possible?
>>
>> /Mikael
>>
>> PS: This is a cross post of the question
>> https://tex.stackexchange.com/q/372857/52406, where I got the
>> suggestion to ask on the list.
>>
>>
>>
>>
>> ___________________________________________________________________________________
>> 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
>>
>> ___________________________________________________________________________________
>>
>
>
> --
>
> -----------------------------------------------------------------
>                                           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
> ___________________________________________________________________________________

Thank you Hans, that works.

Is there also a similar way to use the "kernpairs" instead of "kerns"?
I get no effect, even after adding force = true and
\enabledirectives[fontgoodies.mathkerning].

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

  reply	other threads:[~2017-06-02 15:08 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-02  8:59 Mikael P. Sundqvist
2017-06-02  9:39 ` Mathias Schickel
2017-06-02 11:39   ` Mikael P. Sundqvist
2017-06-02 12:36     ` Mikael P. Sundqvist
2017-06-02 14:24 ` Hans Hagen
2017-06-02 15:08   ` Mikael P. Sundqvist [this message]
2017-06-02 15:56     ` Hans Hagen
2017-06-02 16:01       ` Mikael P. Sundqvist

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAHy-LL_j8KSF7CDzFHCYW2rbV8iwiao7Nw-W3rToG5z9t6XXZQ@mail.gmail.com \
    --to=mickep@gmail.com \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).