Hi Mikael,

math fonts are a bit different from text fonts. This means that you need 
special methods to influence them. Because I once had a similar concern like 
you I asked Hans to implement a way to influence kerning in math fonts between 
certain glyphs. I have attached an lfg-file that shows how to use it.

To enable a goodie file like the one attached you have to define your 
typescript like

\starttypescript [\s!math][cambriaown][\s!all]
        \loadfontgoodies[cambriaown-math]
        \definefontsynonym[\s!MathRoman]        [Cambria-Math]                  
[\s!features={\s!math\mathsizesuffix},\s!designsize=\s!auto,\s!goodies=cambriaown-math]
\stoptypescript

I hope this helps!

Best
Mathias

Attachment: cambriaown-math.lfg
Description: Binary data



> Am 02.06.2017 um 10:59 schrieb Mikael P. Sundqvist <mic...@gmail.com>:
> 
> 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:
> 
> \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.
> <ctx-example20.png>___________________________________________________________________________________
> 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
___________________________________________________________________________________

Reply via email to