[luatex] kerning with delimiters with opentype math fonts
Hans Hagen
pragma at wxs.nl
Sun Feb 19 13:11:12 CET 2017
On 2/18/2017 4:23 PM, David Carlisle wrote:
> 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
>> italic correction is added.
>>
>> 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'll add
italicwidths=yes
but it's up to PG to pick up that pseudo feature in his derived loader
for latex
> 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?)
i think cleaning up the font metrics and kerning of lm is on the gyre
teams agenda (there are some more issues)
> if it is systematic could it be done via the luatex virtual font
> feature rather than actually making a new OTF font?
sure that how the above does it (a typical implemented in 10 minute
trick that i then wonder about if i remember it's there in a few years)
> Not asking for actual code (at this point:-) just bouncing thoughts.....
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
-----------------------------------------------------------------
More information about the luatex
mailing list