texlive[57587] Build/source/texk/web2c/luatexdir: sync with the
commits+kakuto at tug.org
commits+kakuto at tug.org
Mon Feb 1 03:15:42 CET 2021
Revision: 57587
http://tug.org/svn/texlive?view=revision&revision=57587
Author: kakuto
Date: 2021-02-01 03:15:42 +0100 (Mon, 01 Feb 2021)
Log Message:
-----------
sync with the upstream
Modified Paths:
--------------
trunk/Build/source/texk/web2c/luatexdir/ChangeLog
trunk/Build/source/texk/web2c/luatexdir/luatex_svnversion.h
trunk/Build/source/texk/web2c/luatexdir/tex/expand.c
trunk/Build/source/texk/web2c/luatexdir/tex/inputstack.c
trunk/Build/source/texk/web2c/luatexdir/tex/mainbody.c
trunk/Build/source/texk/web2c/luatexdir/tex/mainbody.h
trunk/Build/source/texk/web2c/luatexdir/tex/mlist.c
trunk/Build/source/texk/web2c/luatexdir/tex/printing.c
trunk/Build/source/texk/web2c/luatexdir/tex/printing.h
Modified: trunk/Build/source/texk/web2c/luatexdir/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/luatexdir/ChangeLog 2021-02-01 01:00:11 UTC (rev 57586)
+++ trunk/Build/source/texk/web2c/luatexdir/ChangeLog 2021-02-01 02:15:42 UTC (rev 57587)
@@ -1,3 +1,13 @@
+2021-01-31 Luigi Scarso <luigi.scarso at gmail.com>
+ * mark math glyphs as protected (in order to prevent processing
+ as text in base mode) (H.Hagen)
+ * removed width/ic compensation for traditional math code path
+ (see [Dev-luatex] Duplicated italic correction in do_delimiter ) (H.Hagen)
+
+2021-01-30 Luigi Scarso <luigi.scarso at gmail.com>
+ * level_max and level_chr determing what gets put in front of
+ macro tracing lines (variant on suggestion by PO on implementors list)(H. Hagen)
+
2021-01-13 Luigi Scarso <luigi.scarso at gmail.com>
* pdftex compatibility hack (H. Hagen)
Modified: trunk/Build/source/texk/web2c/luatexdir/luatex_svnversion.h
===================================================================
--- trunk/Build/source/texk/web2c/luatexdir/luatex_svnversion.h 2021-02-01 01:00:11 UTC (rev 57586)
+++ trunk/Build/source/texk/web2c/luatexdir/luatex_svnversion.h 2021-02-01 02:15:42 UTC (rev 57587)
@@ -1 +1 @@
-#define luatex_svn_revision 7397
+#define luatex_svn_revision 7402
Modified: trunk/Build/source/texk/web2c/luatexdir/tex/expand.c
===================================================================
--- trunk/Build/source/texk/web2c/luatexdir/tex/expand.c 2021-02-01 01:00:11 UTC (rev 57586)
+++ trunk/Build/source/texk/web2c/luatexdir/tex/expand.c 2021-02-01 02:15:42 UTC (rev 57587)
@@ -654,7 +654,8 @@
if (tracing_macros_par > 0) {
/*tex Show the text of the macro being expanded. */
begin_diagnostic();
- print_ln();
+ print_input_level();
+ // print_ln();
print_cs(warning_index);
token_show(ref_count);
end_diagnostic(false);
@@ -894,7 +895,9 @@
incr(n);
if (tracing_macros_par > 0) {
begin_diagnostic();
- print_nl(match_chr);
+ print_input_level();
+ // print_nl(match_chr);
+ print(match_chr);
print_int(n);
tprint("<-");
show_token_list(pstack[n - 1], null, 1000);
Modified: trunk/Build/source/texk/web2c/luatexdir/tex/inputstack.c
===================================================================
--- trunk/Build/source/texk/web2c/luatexdir/tex/inputstack.c 2021-02-01 01:00:11 UTC (rev 57586)
+++ trunk/Build/source/texk/web2c/luatexdir/tex/inputstack.c 2021-02-01 02:15:42 UTC (rev 57587)
@@ -525,7 +525,8 @@
iloc = token_link(p);
if (tracing_macros_par > 1) {
begin_diagnostic();
- tprint_nl("");
+ // tprint_nl("");
+ print_input_level();
if (t == mark_text)
tprint_esc("mark");
else if (t == write_text)
Modified: trunk/Build/source/texk/web2c/luatexdir/tex/mainbody.c
===================================================================
--- trunk/Build/source/texk/web2c/luatexdir/tex/mainbody.c 2021-02-01 01:00:11 UTC (rev 57586)
+++ trunk/Build/source/texk/web2c/luatexdir/tex/mainbody.c 2021-02-01 02:15:42 UTC (rev 57587)
@@ -237,6 +237,14 @@
int font_k;
/*tex
+ putting a character in front of a macro trace (feature suggested by PO on
+ tex implementor list
+*/
+
+int level_max;
+int level_chr;
+
+/*tex
maximum number of characters simultaneously present in current lines of open
files and in control sequences between \.{\\csname} and \.{\\endcsname}; must
not exceed |max_halfword|
@@ -378,6 +386,8 @@
setup_bound_var(0, "hash_extra", hash_extra);
setup_bound_var(72, "pk_dpi", pk_dpi);
setup_bound_var(10000, "expand_depth", expand_depth);
+ setup_bound_var(0, "level_max", level_max);
+ setup_bound_var('.', "level_chr", level_chr);
/*tex
Check other constants against their sup and inf.
*/
Modified: trunk/Build/source/texk/web2c/luatexdir/tex/mainbody.h
===================================================================
--- trunk/Build/source/texk/web2c/luatexdir/tex/mainbody.h 2021-02-01 01:00:11 UTC (rev 57586)
+++ trunk/Build/source/texk/web2c/luatexdir/tex/mainbody.h 2021-02-01 02:15:42 UTC (rev 57587)
@@ -68,7 +68,12 @@
# define inf_expand_depth 100
# define sup_expand_depth 10000000
+# define inf_level_max 0
+# define sup_level_max 500
+# define inf_level_chr 1
+# define sup_level_chr 126
+
# include <stdio.h>
/* Types in the outer block */
@@ -125,6 +130,8 @@
extern int half_error_line;
extern int max_print_line;
extern int max_strings;
+extern int level_max;
+extern int level_chr;
extern int strings_free;
extern int font_k;
extern int buf_size;
Modified: trunk/Build/source/texk/web2c/luatexdir/tex/mlist.c
===================================================================
--- trunk/Build/source/texk/web2c/luatexdir/tex/mlist.c 2021-02-01 01:00:11 UTC (rev 57586)
+++ trunk/Build/source/texk/web2c/luatexdir/tex/mlist.c 2021-02-01 02:15:42 UTC (rev 57587)
@@ -63,6 +63,7 @@
#define is_new_mathfont(A) ((font_math_params(A) >0) && (math_old_par == 0))
#define is_old_mathfont(A,B) ((font_math_params(A)==0) && (font_params(A)>=(B)))
#define do_new_math(A) ((font_math_params(A) >0) && (font_oldmath(A) == 0) && (math_old_par == 0))
+#define protect_glyph(A) subtype(A)=256
#include "ptexlib.h"
#include "lua/luatex-api.h"
@@ -1149,6 +1150,7 @@
subtype(b) = math_char_list ;
reset_attributes(b, bb);
p = new_glyph(f, c);
+ protect_glyph(p);
reset_attributes(p, bb);
list_ptr(b) = p;
return b;
@@ -1649,13 +1651,18 @@
if (same != NULL && x == c) {
*same = emas;
}
+ /*tex
+ Here italic is added to width in traditional fonts which makes the delimiter get
+ the real width. An \OPENTYPE\ font already has the right width.
+ */
b = char_box(f, c, att);
- if (!do_new_math(f)) {
- /*tex Italic gets added to width. */
- width(b) += char_italic(f, c);
- }
+ /*tex
+ There is one case where |delta| (ic) gets subtracted but only for a traditional
+ font. In that case the traditional width (which is fake width + italic) becomes
+ less and the delta is added. See (**). (On the mailing list font |ntxexx| was
+ mentioned as test case by MK.)
+ */
if (delta != NULL) {
- /*tex This used to be (f, x). */
*delta = char_italic(f, c);
}
if (stack != NULL)
@@ -3082,9 +3089,18 @@
x = do_delimiter(q, y, text_size, ok_size, false, cur_style, true, NULL, &delta, NULL);
if (delta != 0) {
if (do_new_math(cur_f)) {
- /*tex we never added italic correction */
+ /*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.
+ */
} else if ((subscr(q) != null) && (subtype(q) != op_noad_type_limits)) {
- /*tex remove italic correction */
+ /*tex
+ Here we (selectively) remove the italic correction that always gets added
+ in a traditional font. See (**). In \OPENTYPE\ mode we insert italic kerns,
+ but in traditional mode it's width manipulation. This actually makes sense
+ because those fonts have a fake width and the italic correction sets that
+ right.
+ */
width(x) -= delta;
}
}
@@ -4261,6 +4277,7 @@
*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 (do_new_math(cur_f)) {
if (get_char_cat_code(cur_c) == 11) {
Modified: trunk/Build/source/texk/web2c/luatexdir/tex/printing.c
===================================================================
--- trunk/Build/source/texk/web2c/luatexdir/tex/printing.c 2021-02-01 01:00:11 UTC (rev 57586)
+++ trunk/Build/source/texk/web2c/luatexdir/tex/printing.c 2021-02-01 02:15:42 UTC (rev 57587)
@@ -1297,6 +1297,34 @@
selector = global_old_setting;
}
+/*
+ Indentation (based on a suggestion by PO on tex-implementors but adapted to
+ out situation and with built-in limits and so.
+*/
+
+void print_input_level(void)
+{
+ int m = level_max;
+ if (m) {
+ int l = input_ptr;
+ int c = level_chr > 0 ? level_chr : '.';
+ if (l > m) {
+ tprint_nl("[");
+ print_int((l/m)*m);
+ print(']');
+ l = l % m;
+ } else {
+ print_ln();
+ }
+ while (l > 0) {
+ print(c);
+ l--;
+ }
+ } else {
+ print_ln();
+ }
+}
+
/*tex
Of course we had better declare another global variable, if the previous routines
Modified: trunk/Build/source/texk/web2c/luatexdir/tex/printing.h
===================================================================
--- trunk/Build/source/texk/web2c/luatexdir/tex/printing.h 2021-02-01 01:00:11 UTC (rev 57586)
+++ trunk/Build/source/texk/web2c/luatexdir/tex/printing.h 2021-02-01 02:15:42 UTC (rev 57587)
@@ -124,6 +124,7 @@
extern void print_file_line(void);
extern void begin_diagnostic(void);
+extern void print_input_level(void);
extern void end_diagnostic(boolean blank_line);
extern int global_old_setting;
More information about the tex-live-commits
mailing list.