# [luatex] kerning with delimiters with opentype math fonts

David Carlisle d.p.carlisle at gmail.com
Sat Feb 18 16:23:50 CET 2017

On 18 February 2017 at 15:12, Hans Hagen <pragma at wxs.nl> wrote:
> On 2/18/2017 3:13 PM, David Carlisle wrote:
>>
>> there is a full (plain TeX) example and screenshots in a (non)answer
>> on stackexchange
>>
>> http://tex.stackexchange.com/a/354485
>>
>> but in brief:
>>
>> \left| T \right|
>>
>> has a kern between the T and the right hand | matching the kern in |T|
>>
>> if tfm fonts are used in luatex or xetex or pdftex
>>
>> but if Opentype Latin modern is used
>>
>> xetex shows the kern but luatex has no kern once \right or \Uright are
>> used, but does still show the kern with |T|.
>>
>> I'm not sure if this is a luatex or luaotfload issue?
>
>
> It's a font issue ... try pagella or so ... latin modern has old math font
> like properties so it has char boundingboxes / widths that assume that
>
> For opentype fonts luatex doesn't use the traditional 8 bit font code path.
> Early versions had a kind of hybrid but that failed miserably when more
> opentype mathfonts came around and messy heuristics were dropped in favour
> of separate code paths (not even lua magic could beat that so i dropped most
> of that kind of hackery from context). Kerns have similar issues as opentype
> has staircase kerns.
>
> I can of course add a pseudo feature to the font loader that adds italic to
> the width for fonts that need that. I might also cook up some magic related
> to fences but again it's a macro package issue then.
>
> The best solution is proper fonts.
>
> Hans
>

Hmm not unreasonable from an engine point of view but that still
leaves the users coming to us and us (me at least) not knowing what to
do..

If you add something to the font loader could you ping us so we know
to use it in latex, or ...

I suppose what you are really saying is that best would be a
latin-modern-math-without-legacy-metric-weirdness.otf.
Is it clear what would be need to be done to make such a thing? (is it
a systematic re-adjustment of italic correction and widths for
example?)
if it is systematic could it be done via the luatex virtual font
feature rather than actually making a new OTF font?

Not asking for actual code (at this point:-)  just bouncing thoughts.....

David