# Re: [NTG-context] italic correction after math

On 2/13/2018 6:51 PM, Ulrike Fischer wrote:

Am Tue, 13 Feb 2018 16:26:10 +0100 schrieb Hans Hagen:



basically it boils down to fonts being bad: traditional tex fonts cheat
about the width for italics and have lots or corrections that get always
added as a starter and removed in some cases (heuristics); opentype on
the other hand has proper widths and only applies italics in some cases


But xits is in this case not lying about the italic. The cal-P has a
large overhang and one would like to take this somehow into account.



well, how should math (or whatever) know what comes after it ... in fact, italic correction should be clever enough to decide if what comes after it is also italic


Actually the italic is taken into account *inside* math.
This here inserts \kern1.52 after the "F0151 and \kern2.45 after the
"1D4AB (the math.italic values of these glyphs):


only when it binds with a character


\tracingoutput1 \showboxbreadth\maxdimen \showboxdepth\maxdimen

\font\xits={file:xits-math.otf} at 10pt
\textfont0=\xits
$\Umathchar"7"0"F0151 \Umathchar"7"0"1D4AB \Umathchar"7"0"78$
\bye

The problem is the boundary between math and text. There seem to be
no way to insert automatically or manually the kern if the \cal P
(\Umathchar"7"0"1D4AB) is the last char in the math.


maybe inserting a zerowidthjoiner character helps

$.... \Uchar"200D$


Btw: I found in the luatex manuel the options
\mathoption nocharitalic 1
but it seems to do nothing (the example in the manual show imho
identical output).

these flags are just for testing (the mathoption ones will go away eventually which is why we use \mathoption) .. there are other \math*mode etc parameters

Hans

-----------------------------------------------------------------
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
___________________________________________________________________________________