[tex-live] Ignored italic correction with lua(la)tex format
Khaled Hosny
khaledhosny at eglug.org
Fri Oct 7 00:21:40 CEST 2011
On Thu, Oct 06, 2011 at 11:59:56PM +0200, Philipp Stephani wrote:
> 2011/10/6 Khaled Hosny <khaledhosny at eglug.org>:
> > On Thu, Oct 06, 2011 at 11:31:38PM +0200, Philipp Stephani wrote:
> >> 2011/10/6 Khaled Hosny <khaledhosny at eglug.org>:
> >> > Hi all,
> >> >
> >> > After a long night of debugging and hair pulling, I finally found why
> >> > italic correction for OpenType math fonts is ignored in luatex and
> >> > lualatex formats but not in context.
> >> >
> >> > For some reason not yet clear to me, the setting of catcode to 11 in
> >> > luatex-unicode-letters.tex causes luatex to not apply italic correction
> >> > (might be related to the fact that luatex applies IC selectively).
> >> >
> >> > This minimal example shows the issues:
> >> >
> >> > \input luaotfload.sty
> >> > \font\xits={file:xits-math.otf} at 10pt
> >> > \textfont0=\xits
> >> > $$\Umathchar"7"0"1D443\Umathchar"4"0`($$
> >> > \bye
> >> >
> >> > after commenting the \catcode part in line 18 of
> >> > luatex-unicode-letters.tex and rebuilding the format, italic correction
> >> > is applied.
> >> >
> >> > I'm not sure what is the proper fix here, though.
> >>
> >> LuaTeX explicitly removes italic correction after letters:
> >>
> >> if (is_new_mathfont(cur_f) && get_char_cat_code(cur_c) == 11) {
> >> *delta = 0; /* no italic correction in mid-word of
> >> text font */
> >> }
> >>
> >> This seems like a bug to me.
> >
> > This is on purpose, following to MS implementation/Cambria Math.
>
> How can this be, given that Word has no catcodes? Anyway, with Cambria
> Math it works as expected, maybe even a font bug?
Word does not apply italic correction between letters (i.e. middle of
the word), catcodes it what luatex is using ti differentiate letters
from non-letters. Cambria has minimal italic correction so the
difference is not so visible and its sub/superscripts are handled with
math kerning so the difference is even more invisible. XITS renders fine
in Word.
> > In
> > either case it makes no sense IMO to give non-letter characters a letter
> > catcode.
>
> The italic P you used in your example is a letter, and the parenthesis
> has catcode 12.
I see, but then I don't know what the exact detail of what luatex is
doing, all I know is that it applies italic correction selectively.
Regards,
Khaled
--
Khaled Hosny
Egyptian
Arab
More information about the tex-live
mailing list