diff --git a/manual/luatex-math.tex b/manual/luatex-math.tex index d80c1c1ea1e1670494101f270745114964f97108..cf0bb1737500f1d70cc83df303ce5506e7400391 100644 --- a/manual/luatex-math.tex +++ b/manual/luatex-math.tex @@ -773,120 +773,120 @@ hasn't been the case since the start of the project. Changing it could break hacks that users came up with but when you set \lpr {matheqdirmode} to a positive value direction will be taken into account. -\subsection {Nolimit correction} - -\topicindex {math+limits} - -There are two extra math parameters \lpr {Umathnolimitsupfactor} and \lpr -{Umathnolimitsubfactor} that were added to provide some control over how limits -are spaced (for example the position of super and subscripts after integral -operators). They relate to an extra parameter \lpr {mathnolimitsmode}. The half -corrections are what happens when scripts are placed above and below. The -problem with italic corrections is that officially that correction italic is used -for above|/|below placement while advanced kerns are used for placement at the -right end. The question is: how often is this implemented, and if so, do the -kerns assume correction too. Anyway, with this parameter one can control it. - -\starttabulate[|l|ck1|ck1|ck1|ck1|ck1|ck1|] - \NC % probably not ok, we need a raw int here - \NC \mathnolimitsmode0 $\displaystyle\mathop{\normalint}\nolimits^0_1$ - \NC \mathnolimitsmode1 $\displaystyle\mathop{\normalint}\nolimits^0_1$ - \NC \mathnolimitsmode2 $\displaystyle\mathop{\normalint}\nolimits^0_1$ - \NC \mathnolimitsmode3 $\displaystyle\mathop{\normalint}\nolimits^0_1$ - \NC \mathnolimitsmode4 $\displaystyle\mathop{\normalint}\nolimits^0_1$ - \NC \mathnolimitsmode8000 $\displaystyle\mathop{\normalint}\nolimits^0_1$ - \NC \NR - \TB - \BC mode - \NC \tttf 0 - \NC \tttf 1 - \NC \tttf 2 - \NC \tttf 3 - \NC \tttf 4 - \NC \tttf 8000 - \NC \NR - \BC superscript - \NC 0 - \NC font - \NC 0 - \NC 0 - \NC +ic/2 - \NC 0 - \NC \NR - \BC subscript - \NC -ic - \NC font - \NC 0 - \NC -ic/2 - \NC -ic/2 - \NC 8000ic/1000 - \NC \NR -\stoptabulate - -When the mode is set to one, the math parameters are used. This way a macro -package writer can decide what looks best. Given the current state of fonts in -\CONTEXT\ we currently use mode 1 with factor 0 for the superscript and 750 for -the subscripts. Positive values are used for both parameters but the subscript -shifts to the left. A \lpr {mathnolimitsmode} larger that 15 is considered to -be a factor for the subscript correction. This feature can be handy when -experimenting. - -\subsection {Math italic mess} - -\topicindex {math+italics} - -The \lpr {mathitalicsmode} parameter was introduced to deal with the difference -in applying italic correction in traditional and \OPENTYPE\ math fonts. There are -\OPENTYPE\ fonts out there that have italic correction and assume them to be -applied like traditional \TEX\ fonts. This parameter takes several values: - -When set to zero, you get what was decided when the two code paths (traditional -and \OPENTYPE) were introduced. - -Values larger than zero will add the italic correction between simple noads (it -checks some classes so you might pay attention to for instance punctuation -classes assigned). - -When set to zero or one, italics are independent, so we separate width from -italic, while values larger than one combine both in the width but later -selectively has to get rid of it (depending on code path). - -A value larger than two will backtrack italics for large operators, because there -italic correction is used for anchoring scripts (limits and no limits). In fact, -\OPENTYPE\ uses italics either between characters or for this purpose but as -mentioned fonts are sort of messy here. - -We tested our version of plain \TEX\ and recommend to use the value of three to -get the best average results. More about this italic correction dilemma in -rendering math can be found in articles (in for instance \TUGBOAT) and various -documents in the \CONTEXT\ distribution, especially those that discuss the -upgraded math engine in \LUAMETATEX. - -% The \lpr {mathitalicsmode} parameter can be set to~1 to force italic correction -% before noads that represent some more complex structure (read: everything that is -% not an ord, bin, rel, open, close, punct or inner). A value of~2 will enforce the -% old school font code path for all italics. We show a Cambria example. +% \subsection {Nolimit correction} +% +% \topicindex {math+limits} % -% \starttexdefinition Whatever #1 -% \NC \type{\mathitalicsmode = #1} -% \NC \mathitalicsmode#1\ruledhbox{$\left|T^1\right|$} -% \NC \mathitalicsmode#1\ruledhbox{$\left|T\right|$} -% \NC \mathitalicsmode#1\ruledhbox{$T+1$} -% \NC \mathitalicsmode#1\ruledhbox{$T{1\over2}$} -% \NC \mathitalicsmode#1\ruledhbox{$T\sqrt{1}$} +% There are two extra math parameters \lpr {Umathnolimitsupfactor} and \lpr +% {Umathnolimitsubfactor} that were added to provide some control over how limits +% are spaced (for example the position of super and subscripts after integral +% operators). They relate to an extra parameter \lpr {mathnolimitsmode}. The half +% corrections are what happens when scripts are placed above and below. The +% problem with italic corrections is that officially that correction italic is used +% for above|/|below placement while advanced kerns are used for placement at the +% right end. The question is: how often is this implemented, and if so, do the +% kerns assume correction too. Anyway, with this parameter one can control it. + +% \starttabulate[|l|ck1|ck1|ck1|ck1|ck1|ck1|] +% \NC % probably not ok, we need a raw int here +% \NC \mathnolimitsmode0 $\displaystyle\mathop{\normalint}\nolimits^0_1$ +% \NC \mathnolimitsmode1 $\displaystyle\mathop{\normalint}\nolimits^0_1$ +% \NC \mathnolimitsmode2 $\displaystyle\mathop{\normalint}\nolimits^0_1$ +% \NC \mathnolimitsmode3 $\displaystyle\mathop{\normalint}\nolimits^0_1$ +% \NC \mathnolimitsmode4 $\displaystyle\mathop{\normalint}\nolimits^0_1$ +% \NC \mathnolimitsmode8000 $\displaystyle\mathop{\normalint}\nolimits^0_1$ +% \NC \NR +% \TB +% \BC mode +% \NC \tttf 0 +% \NC \tttf 1 +% \NC \tttf 2 +% \NC \tttf 3 +% \NC \tttf 4 +% \NC \tttf 8000 +% \NC \NR +% \BC superscript +% \NC 0 +% \NC font +% \NC 0 +% \NC 0 +% \NC +ic/2 +% \NC 0 % \NC \NR -% \stoptexdefinition +% \BC subscript +% \NC -ic +% \NC font +% \NC 0 +% \NC -ic/2 +% \NC -ic/2 +% \NC 8000ic/1000 +% \NC \NR +% \stoptabulate +% +% When the mode is set to one, the math parameters are used. This way a macro +% package writer can decide what looks best. Given the current state of fonts in +% \CONTEXT\ we currently use mode 1 with factor 0 for the superscript and 750 for +% the subscripts. Positive values are used for both parameters but the subscript +% shifts to the left. A \lpr {mathnolimitsmode} larger that 15 is considered to +% be a factor for the subscript correction. This feature can be handy when +% experimenting. + +% \subsection {Math italic mess} +% +% \topicindex {math+italics} +% +% The \lpr {mathitalicsmode} parameter was introduced to deal with the difference +% in applying italic correction in traditional and \OPENTYPE\ math fonts. There are +% \OPENTYPE\ fonts out there that have italic correction and assume them to be +% applied like traditional \TEX\ fonts. This parameter takes several values: +% +% When set to zero, you get what was decided when the two code paths (traditional +% and \OPENTYPE) were introduced. +% +% Values larger than zero will add the italic correction between simple noads (it +% checks some classes so you might pay attention to for instance punctuation +% classes assigned). +% +% When set to zero or one, italics are independent, so we separate width from +% italic, while values larger than one combine both in the width but later +% selectively has to get rid of it (depending on code path). +% +% A value larger than two will backtrack italics for large operators, because there +% italic correction is used for anchoring scripts (limits and no limits). In fact, +% \OPENTYPE\ uses italics either between characters or for this purpose but as +% mentioned fonts are sort of messy here. % -% \start -% \switchtobodyfont[cambria] -% \starttabulate[|c|c|c|c|c|c|] -% \Whatever{0}% -% \Whatever{1}% -% \stoptabulate -% \stop +% We tested our version of plain \TEX\ and recommend to use the value of three to +% get the best average results. More about this italic correction dilemma in +% rendering math can be found in articles (in for instance \TUGBOAT) and various +% documents in the \CONTEXT\ distribution, especially those that discuss the +% upgraded math engine in \LUAMETATEX. % -% This kind of parameters relate to the fact that italic correction in \OPENTYPE\ -% math is bound to fuzzy rules. So, control is the solution. +% % The \lpr {mathitalicsmode} parameter can be set to~1 to force italic correction +% % before noads that represent some more complex structure (read: everything that is +% % not an ord, bin, rel, open, close, punct or inner). A value of~2 will enforce the +% % old school font code path for all italics. We show a Cambria example. +% % +% % \starttexdefinition Whatever #1 +% % \NC \type{\mathitalicsmode = #1} +% % \NC \mathitalicsmode#1\ruledhbox{$\left|T^1\right|$} +% % \NC \mathitalicsmode#1\ruledhbox{$\left|T\right|$} +% % \NC \mathitalicsmode#1\ruledhbox{$T+1$} +% % \NC \mathitalicsmode#1\ruledhbox{$T{1\over2}$} +% % \NC \mathitalicsmode#1\ruledhbox{$T\sqrt{1}$} +% % \NC \NR +% % \stoptexdefinition +% % +% % \start +% % \switchtobodyfont[cambria] +% % \starttabulate[|c|c|c|c|c|c|] +% % \Whatever{0}% +% % \Whatever{1}% +% % \stoptabulate +% % \stop +% % +% % This kind of parameters relate to the fact that italic correction in \OPENTYPE\ +% % math is bound to fuzzy rules. So, control is the solution. \subsection {Script and kerning} diff --git a/manual/luatex.pdf b/manual/luatex.pdf index 99d5ab2f6ed7399a2691455be44081299385de79..7cd3ef89b89e85eb281b096de865eeeaeb1aead6 100644 Binary files a/manual/luatex.pdf and b/manual/luatex.pdf differ diff --git a/source/texk/web2c/luatexdir/ChangeLog b/source/texk/web2c/luatexdir/ChangeLog index 2c8bbeaba5df16bc6e326aa43f1cffac395789a7..1f9455bb2f98319efb663429de4336866f5395c2 100644 --- a/source/texk/web2c/luatexdir/ChangeLog +++ b/source/texk/web2c/luatexdir/ChangeLog @@ -1,10 +1,17 @@ +2025-03-16 Luigi Scarso <luigi.scarso@gmail.com> + * always use old school tex logic (also for opentype) wrt italics + with exception for large operators in opentyep fonts (no mixed font + usage); all related control modes removed (H.Hagen) + + 2025-03-15 Luigi Scarso <luigi.scarso@gmail.com> - * : italicsmode fix for eight bit fonts (H.Hagen) + * italicsmode fix for eight bit fonts (H.Hagen) + 2025-03-13 Luigi Scarso <luigi.scarso@gmail.com> * extra italicsmode (large operator italic spacing) (H.Hagen) - + 2025-02-28 Akira Kakuto <kakuto@jcom.zaq.ne.jp> * luatex.c: Remove problematic lines for windows diff --git a/source/texk/web2c/luatexdir/luatex_svnversion.h b/source/texk/web2c/luatexdir/luatex_svnversion.h index 8cf3a48fe6999b81e609a8e350fe62fa844547b3..ddf0547d525864a55db75242fa969fdad273f15f 100644 --- a/source/texk/web2c/luatexdir/luatex_svnversion.h +++ b/source/texk/web2c/luatexdir/luatex_svnversion.h @@ -1,4 +1,4 @@ #ifndef luatex_svn_revision_h #define luatex_svn_revision_h -#define luatex_svn_revision 7672 +#define luatex_svn_revision 7673 #endif diff --git a/source/texk/web2c/luatexdir/tex/mlist.c b/source/texk/web2c/luatexdir/tex/mlist.c index 08faee64e4f5b87da49e602e309ce9f864d2315e..d93d36e5221eef9f7823a6971d3f478864c825e5 100644 --- a/source/texk/web2c/luatexdir/tex/mlist.c +++ b/source/texk/web2c/luatexdir/tex/mlist.c @@ -17,6 +17,18 @@ LuaTeX; if not, see <http://www.gnu.org/licenses/>. */ +/*tex + + These are now obsolete: + + \starttyping + \Umathnolimitsupfactor + \Umathnolimitsubfactor + \mathnolimitsmode + \mathitalicssmode + \mathoption + \stoptyping + /*tex In traditional \TeX\ the italic correction is added to the width of the @@ -58,6 +70,18 @@ LuaTeX; if not, see <http://www.gnu.org/licenses/>. italics. Axis are another area of concern, as it looks like opentype math fonts often already apply that shift. + The first public font that we tested was Latin Modern. Here again italic + correction is present. The same is true for later fonts, like Pagella. This + presents a problem: we need to add the correction but then also ignore it + when we have a large operator that has limits or no limits, something that + needs to be known explicitly. We used to have a few modes to control this, + one that controlled the anchoring of sub scripts, as these depend on the + italic correction, and one for dealing with the operators. In the end we + decided to ditch these because there is no way to consistently set up the + engine, we now just accept the fact that fonts are a mixed bag: traditional + width plus italic as well as italic used for limits. However, for opentype + fonts we have a code path that compensates for the width. + */ /*tex @@ -67,22 +91,10 @@ LuaTeX; if not, see <http://www.gnu.org/licenses/>. or old font. It's a bit guesswork especially when it comes to italics. */ -# define trace_italics 0 - -// is_new_mathfont(A) ((font_math_params(A) > 0) && (math_old_par == 0)) -// is_old_mathfont(A,B) ((font_math_params(A) == 0) && (font_params(A) >= (B))) -// do_new_math(A) ((font_math_params(A) > 0) && (font_oldmath(A) == 0) && (math_old_par == 0)) - #define is_new_mathfont(A) ((font_math_params(A) > 0)) #define is_old_mathfont(A,B) ((font_math_params(A) == 0) && (font_params(A) >= (B))) #define assume_new_math(A) ((font_math_params(A) > 0) && (font_oldmath(A) == 0)) -// do_new_math_but_not(A) (math_italics_mode_par > 1 ? 0 : do_new_math(A)) - -#define math_italics_between_simple(A) (math_italics_mode_par > 0) // 1 and higher -#define math_italics_independent_italic(A) (math_italics_mode_par > 1 ? 0 : assume_new_math(A)) -#define math_italics_backtrack_operator(A) (math_italics_mode_par > 2 ? assume_new_math(A) : 0) // 3 or more - #define protect_glyph(A) subtype(A) = 256 #include "ptexlib.h" @@ -397,14 +409,14 @@ static scaled do_get_math_param_or_error(int var, int param, const char *name) return a; } -static scaled do_get_math_param_or_zero(int var, int param, const char *name) -{ - scaled a = get_math_param(param, var); - if (a == undefined_math_parameter) { - a = 0; - } - return a; -} +// static scaled do_get_math_param_or_zero(int var, int param, const char *name) +// { +// scaled a = get_math_param(param, var); +// if (a == undefined_math_parameter) { +// a = 0; +// } +// return a; +// } /*tex @@ -1161,14 +1173,7 @@ static pointer char_box(internal_font_number f, int c, pointer bb) /*tex The new box and its character node. */ pointer b, p; b = new_null_box(); - if (math_italics_independent_italic(f)) { -# if trace_italics - printf("[math italics independent italic 1]\n"); -# endif - width(b) = char_width(f, c); - } else { - width(b) = char_width(f, c) + char_italic(f, c); - } + width(b) = char_width(f, c) + char_italic(f, c); height(b) = char_height(f, c); depth(b) = char_depth(f, c); subtype(b) = math_char_list ; @@ -2747,15 +2752,9 @@ static void do_make_math_accent(pointer q, internal_font_number f, int c, int fl delta = delta + height(x) - h; h = height(x); } - } else if ((vlink(q) != null) && (type(nucleus(q)) == math_char_node)) { - /*tex only pure math char nodes */ - internal_font_number f = fam_fnt(math_fam(nucleus(q)),cur_size); - if (math_italics_independent_italic(f)) { -# if trace_italics - printf("[math italics independent italic 2]\n"); -# endif - ic = char_italic(f,math_character(nucleus(q))); - } +// } else if ((vlink(q) != null) && (type(nucleus(q)) == math_char_node)) { +// /*tex only pure math char nodes */ +// internal_font_number f = fam_fnt(math_fam(nucleus(q)),cur_size); } /*tex the top accents of both characters are aligned */ if (s_is_absolute) { @@ -3117,14 +3116,14 @@ static scaled make_op(pointer q, int cur_style) { /*tex offset between subscript and superscript */ scaled delta = 0; - scaled dummy = 0; /*tex temporary registers for box construction */ - pointer p, v, x, y, z, n; + pointer p, v, x, y, z; /*tex register for character examination */ int c; /*tex dimensions for box calculation */ scaled shift_up, shift_down; boolean axis_shift = false; + int opentype = assume_new_math(cur_f); scaled ok_size; if ((subtype(q) == op_noad_type_normal) && (cur_style < text_style)) { subtype(q) = op_noad_type_limits; @@ -3142,20 +3141,7 @@ static scaled make_op(pointer q, int cur_style) small_char(y) = math_character(nucleus(q)); x = do_delimiter(q, y, text_size, ok_size, false, cur_style, true, NULL, &delta, NULL); if (delta != 0) { - if (math_italics_backtrack_operator(cur_f)) { - width(x) -= delta; -# if trace_italics - printf("[math italics backtrack operator 1]\n"); -# endif - } else if (math_italics_independent_italic(cur_f)) { - /*tex - As we never added italic correction we don't need to compensate. The ic - is stored in a special field of the node and applied in some occasions. - */ -# if trace_italics - printf("[math italics independent italic 3]\n"); -# endif - } else if ((subscr(q) != null) && (subtype(q) != op_noad_type_limits)) { + if ((subscr(q) != null) && (subtype(q) != op_noad_type_limits)) { /*tex Here we (selectively) remove the italic correction that always gets added in a traditional font. See (**). In \OPENTYPE\ mode we insert italic kerns, @@ -3178,17 +3164,7 @@ static scaled make_op(pointer q, int cur_style) delta = char_italic(cur_f, cur_c); x = clean_box(nucleus(q), cur_style, cur_style, math_nucleus_list); if (delta != 0) { - if (math_italics_backtrack_operator(cur_f)) { - width(x) -= delta; -# if trace_italics - printf("[math italics backtrack operator 2]\n"); -# endif - } else if (math_italics_independent_italic(cur_f)) { - /*tex we never added italic correction */ -# if trace_italics - printf("[math italics independent italic 4]\n"); -# endif - } else if ((subscr(q) != null) && (subtype(q) != op_noad_type_limits)) { + if ((subscr(q) != null) && (subtype(q) != op_noad_type_limits)) { /*tex remove italic correction */ width(x) -= delta; } @@ -3200,23 +3176,13 @@ static scaled make_op(pointer q, int cur_style) delta = char_italic(cur_f, cur_c); x = clean_box(nucleus(q), cur_style, cur_style, math_nucleus_list); if (delta != 0) { - if (math_italics_backtrack_operator(cur_f)) { - width(x) -= delta; -# if trace_italics - printf("[math italics backtrack operator 3]\n"); -# endif - } else if (math_italics_independent_italic(cur_f)) { - /*tex we never added italic correction */ -# if trace_italics - printf("[math italics independent italic 5]\n"); -# endif - } else if ((subscr(q) != null) && (subtype(q) != op_noad_type_limits)) { + if ((subscr(q) != null) && (subtype(q) != op_noad_type_limits)) { /*tex remove italic correction */ width(x) -= delta; } } axis_shift = true; - } + } if (axis_shift) { /*tex center vertically */ shift_amount(x) = half(height(x) - depth(x)) - math_axis_size(cur_size); @@ -3226,80 +3192,15 @@ static scaled make_op(pointer q, int cur_style) } /*tex we now handle op_nod_type_no_limits here too */ if (subtype(q) == op_noad_type_no_limits) { -if (math_italics_backtrack_operator(cur_f)) { -# if trace_italics - printf("[math italics backtrack operator 4]\n"); -# endif - /*tex - Not: - - \starttyping - if (delta != 0) { - delta = half(delta) ; - } - \stoptyping - */ - p = check_nucleus_complexity(q, &dummy, cur_style, NULL); - if ((subscr(q) == null) && (supscr(q) == null)) { - assign_new_hlist(q, p); - } else { - /*tex - Not: - - \starttyping - make_scripts(q, p, 0, cur_style, delta, -delta); - \stoptyping - */ - int mode = math_nolimits_mode_par; /* wins */ - /*tex - - For easy configuration ... fonts are somewhat inconsistent - and the values for italic correction run from 30 to 60\% of. - the width. - - */ - switch (mode) { - case 0 : - /*tex full bottom correction */ - make_scripts(q, p, 0, cur_style, 0, -delta); - break; - case 1 : - /*tex |MathConstants| driven */ - make_scripts(q, p, 0, cur_style, - round_xn_over_d(delta, nolimit_sup_factor(cur_style), 1000), - -round_xn_over_d(delta, nolimit_sub_factor(cur_style), 1000)); - break ; - case 2 : - /*tex no correction */ - make_scripts(q, p, 0, cur_style, 0, 0); - break ; - case 3 : - /*tex half bottom correction */ - make_scripts(q, p, 0, cur_style, 0, -half(delta)); - break; - case 4 : - /*tex half bottom and top correction */ - make_scripts(q, p, 0, cur_style, half(delta), -half(delta)); - break; - default : - if (mode > 15) { - /*tex for quickly testing values */ - make_scripts(q, p, 0, cur_style, 0, -round_xn_over_d(delta, mode, 1000)); - } else { - make_scripts(q, p, 0, cur_style, 0, 0); - } - break; - } - } - delta = 0; + /*tex similar code then the caller (before CHECK_DIMENSIONS) */ + p = check_nucleus_complexity(q, &delta, cur_style, NULL); + if (opentype) { + width(p) -= delta; + } + if ((subscr(q) == null) && (supscr(q) == null)) { + assign_new_hlist(q, p); } else { - /*tex similar code then the caller (before CHECK_DIMENSIONS) */ - p = check_nucleus_complexity(q, &delta, cur_style, NULL); - if ((subscr(q) == null) && (supscr(q) == null)) { - assign_new_hlist(q, p); - } else { - make_scripts(q, p, delta, cur_style, 0, 0); - } + make_scripts(q, p, delta, cur_style, 0, 0); } } else if (subtype(q) == op_noad_type_limits) { /*tex @@ -3316,57 +3217,26 @@ if (math_italics_backtrack_operator(cur_f)) { reset_attributes(v, node_attr(q)); type(v) = vlist_node; subtype(v) = math_limits_list; - if (math_italics_independent_italic(cur_f)) { -# if trace_italics - printf("[math italics independent italic 6]\n"); -# endif - n = nucleus(q); - if (n != null) { - if ((type(n) == sub_mlist_node) || (type(n) == sub_box_node)) { - n = math_list(n); - if (n != null) { - if (type(n) == hlist_node) { - /*tex just a not scaled char */ - n = list_ptr(n); - while (n != null) { - if (type(n) == glyph_node) { - delta = char_italic(font(n),character(n)); - } - n = vlink(n); - } - } else { - while (n != null) { - if (type(n) == fence_noad) { - if (delimiteritalic(n) > delta) { - /*tex we can have dummies, the period ones */ - delta = delimiteritalic(n); - } - } - n = vlink(n); - } - } - } - } else { - n = nucleus(q); - if (type(n) == math_char_node) { - delta = char_italic(fam_fnt(math_fam(n),cur_size),math_character(n)); - } - } - } - } width(v) = width(y); - if (width(x) > width(v)) + /* rebox fixes the width and ignores italic */ + if (width(x) > width(v)) { width(v) = width(x); - if (width(z) > width(v)) + } + if (width(z) > width(v)) { width(v) = width(z); + } x = rebox(x, width(v)); y = rebox(y, width(v)); z = rebox(z, width(v)); - shift_amount(x) = half(delta); + shift_amount(x) = half(delta); /* sup */ shift_amount(z) = -shift_amount(x); /*tex v is the still empty target */ height(v) = height(y); depth(v) = depth(y); + if (opentype) { + width(v) -= delta; + delta = 0; + } /*tex Attach the limits to |y| and adjust |height(v)|, |depth(v)| to @@ -3426,12 +3296,6 @@ if (math_italics_backtrack_operator(cur_f)) { supscr(q) = null; } assign_new_hlist(q, v); - if (math_italics_independent_italic(cur_f)) { -# if trace_italics - printf("[math italics independent italic 7]\n"); -# endif - delta = 0; - } } return delta; } @@ -3477,19 +3341,6 @@ static void make_ord(pointer q) type(nucleus(q)) = math_text_char_node; fetch(nucleus(q)); a = cur_c; - /*tex add italic correction */ - if (math_italics_independent_italic(cur_f) && (char_italic(cur_f,math_character(nucleus(q))) != 0)) { -# if trace_italics - printf("[math italics independent italic 8]\n"); -# endif - - p = new_kern(char_italic(cur_f,math_character(nucleus(q)))); - subtype(p) = italic_kern; - reset_attributes(p, node_attr(q)); - couple_nodes(p,vlink(q)); - couple_nodes(q,p); - return; - } /*tex construct ligatures, quite unlikely in new math fonts */ if ((has_kern(cur_f, a)) || (has_lig(cur_f, a))) { cur_c = math_character(nucleus(p)); @@ -4352,7 +4203,7 @@ static pointer check_nucleus_complexity(halfword q, scaled * delta, int cur_styl { pointer p = null; pointer t = null; - if (same != NULL) { + if (same) { *same = 0; } switch (type(nucleus(q))) { @@ -4361,37 +4212,14 @@ static pointer check_nucleus_complexity(halfword q, scaled * delta, int cur_styl fetch(nucleus(q)); if (char_exists(cur_f, cur_c)) { /*tex we could look at neighbours */ - if (math_italics_independent_italic(cur_f)) { - /*tex cf spec only the last one */ -# if trace_italics - printf("[math italics independent italic 9]\n"); -# endif - *delta = 0 ; - } else { - *delta = char_italic(cur_f, cur_c); - } + *delta = char_italic(cur_f, cur_c); p = new_glyph(cur_f, cur_c); protect_glyph(p); reset_attributes(p, node_attr(nucleus(q))); - if (math_italics_backtrack_operator(cur_f)) { -# if trace_italics - printf("[math italics backtrack operator 5]\n"); -# endif - /* do nothing */ - } else if (math_italics_independent_italic(cur_f)) { -# if trace_italics - printf("[math italics independent italic 10]\n"); -# endif - if (get_char_cat_code(cur_c) == 11) { - /*tex no italic correction in mid-word of text font */ - *delta = 0; - } - } else { - /*tex no italic correction in mid-word of text font */ - if (((type(nucleus(q))) == math_text_char_node) && (space(cur_f) != 0)) { - *delta = 0; - } - } + // /*tex no italic correction in mid-word of text font */ + // if (((type(nucleus(q))) == math_text_char_node) && (space(cur_f) != 0)) { + // *delta = 0; + // } /*tex so we only add italic correction when we have no scripts */ if ((subscr(q) == null) && (supscr(q) == null) && (*delta != 0)) { pointer x = new_kern(*delta); @@ -4399,13 +4227,6 @@ static pointer check_nucleus_complexity(halfword q, scaled * delta, int cur_styl reset_attributes(x, node_attr(nucleus(q))); couple_nodes(p,x); *delta = 0; - } else if (math_italics_independent_italic(cur_f)) { - /*tex Needs checking but looks ok. It must be more selective. */ -# if trace_italics - printf("[math italics independent italic 11]\n"); -# endif - - *delta = char_italic(cur_f, cur_c); } } break; @@ -4455,7 +4276,6 @@ void mlist_to_hlist(pointer mlist, boolean penalties, int cur_style) pointer p = null; pointer pp = null; pointer z = null; - halfword nxt ; int same = 0; /*tex a penalty to be inserted */ int pen; @@ -4491,7 +4311,6 @@ void mlist_to_hlist(pointer mlist, boolean penalties, int cur_style) */ RESWITCH: delta = 0; - nxt = vlink(q); switch (type(q)) { case simple_noad: switch (subtype(q)) { @@ -4703,43 +4522,6 @@ void mlist_to_hlist(pointer mlist, boolean penalties, int cur_style) the scripts so if it's optional here it also should be there. */ - if (nxt && math_italics_between_simple(null) && (delta != 0)) { -# if trace_italics - printf("[math italics between simple 1]\n"); -# endif - if (type(nxt) == simple_noad) { - switch (subtype(nxt)) { - case ord_noad_type: - case bin_noad_type: - case rel_noad_type: - case open_noad_type: - case close_noad_type: - case punct_noad_type: - delta = 0; - break; - case inner_noad_type: - if (! delimitermodeitalics) { - delta = 0; - } - break; - case op_noad_type_normal: - case op_noad_type_limits: - case op_noad_type_no_limits: - case under_noad_type: - case over_noad_type: - case vcenter_noad_type: - break; - default: - break; - } - } - if (delta != 0) { - pointer d = new_kern(delta); - subtype(d) = italic_kern; - reset_attributes(d, node_attr(q)); - couple_nodes(p,d); - } - } assign_new_hlist(q, p); } else { /*tex top, bottom */