summaryrefslogtreecommitdiff
path: root/Build
diff options
context:
space:
mode:
authorAkira Kakuto <kakuto@fuk.kindai.ac.jp>2021-02-01 02:15:42 +0000
committerAkira Kakuto <kakuto@fuk.kindai.ac.jp>2021-02-01 02:15:42 +0000
commit9d694205709f79666458dc2ee685767b28bcd9ac (patch)
tree0a41d56fdbc60977f75435deb3a43f155f48322e /Build
parent6b626266b690e8f626829f7029a0b15b767fdfd1 (diff)
sync with the upstream
git-svn-id: svn://tug.org/texlive/trunk@57587 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rw-r--r--Build/source/texk/web2c/luatexdir/ChangeLog10
-rw-r--r--Build/source/texk/web2c/luatexdir/luatex_svnversion.h2
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/expand.c7
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/inputstack.c3
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/mainbody.c10
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/mainbody.h7
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/mlist.c31
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/printing.c28
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/printing.h1
9 files changed, 88 insertions, 11 deletions
diff --git a/Build/source/texk/web2c/luatexdir/ChangeLog b/Build/source/texk/web2c/luatexdir/ChangeLog
index 93bdcaf7da0..3c3dc892b35 100644
--- a/Build/source/texk/web2c/luatexdir/ChangeLog
+++ b/Build/source/texk/web2c/luatexdir/ChangeLog
@@ -1,3 +1,13 @@
+2021-01-31 Luigi Scarso <luigi.scarso@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@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@gmail.com>
* pdftex compatibility hack (H. Hagen)
diff --git a/Build/source/texk/web2c/luatexdir/luatex_svnversion.h b/Build/source/texk/web2c/luatexdir/luatex_svnversion.h
index 0eb59f10988..c91a2c84ab3 100644
--- a/Build/source/texk/web2c/luatexdir/luatex_svnversion.h
+++ b/Build/source/texk/web2c/luatexdir/luatex_svnversion.h
@@ -1 +1 @@
-#define luatex_svn_revision 7397
+#define luatex_svn_revision 7402
diff --git a/Build/source/texk/web2c/luatexdir/tex/expand.c b/Build/source/texk/web2c/luatexdir/tex/expand.c
index bdf82c8c0da..e85c8f3bdb6 100644
--- a/Build/source/texk/web2c/luatexdir/tex/expand.c
+++ b/Build/source/texk/web2c/luatexdir/tex/expand.c
@@ -654,7 +654,8 @@ void macro_call(void)
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 @@ void macro_call(void)
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);
diff --git a/Build/source/texk/web2c/luatexdir/tex/inputstack.c b/Build/source/texk/web2c/luatexdir/tex/inputstack.c
index ad67ac24820..6b0e1a055eb 100644
--- a/Build/source/texk/web2c/luatexdir/tex/inputstack.c
+++ b/Build/source/texk/web2c/luatexdir/tex/inputstack.c
@@ -525,7 +525,8 @@ void begin_token_list(halfword p, quarterword t)
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)
diff --git a/Build/source/texk/web2c/luatexdir/tex/mainbody.c b/Build/source/texk/web2c/luatexdir/tex/mainbody.c
index 9116d8bdb67..2f45f9989d2 100644
--- a/Build/source/texk/web2c/luatexdir/tex/mainbody.c
+++ b/Build/source/texk/web2c/luatexdir/tex/mainbody.c
@@ -237,6 +237,14 @@ int strings_free;
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 @@ int main_initialize(void)
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.
*/
diff --git a/Build/source/texk/web2c/luatexdir/tex/mainbody.h b/Build/source/texk/web2c/luatexdir/tex/mainbody.h
index 245535120c8..0d274aeffbe 100644
--- a/Build/source/texk/web2c/luatexdir/tex/mainbody.h
+++ b/Build/source/texk/web2c/luatexdir/tex/mainbody.h
@@ -68,6 +68,11 @@ in production versions of \TeX.
# 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>
@@ -125,6 +130,8 @@ extern int error_line;
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;
diff --git a/Build/source/texk/web2c/luatexdir/tex/mlist.c b/Build/source/texk/web2c/luatexdir/tex/mlist.c
index c34dee48839..2ac631ea339 100644
--- a/Build/source/texk/web2c/luatexdir/tex/mlist.c
+++ b/Build/source/texk/web2c/luatexdir/tex/mlist.c
@@ -63,6 +63,7 @@ LuaTeX; if not, see <http://www.gnu.org/licenses/>.
#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 @@ static pointer char_box(internal_font_number f, int c, pointer bb)
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 @@ static pointer do_delimiter(pointer q, pointer d, int s, scaled v, boolean flat,
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 @@ static scaled make_op(pointer q, int cur_style)
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 @@ static pointer check_nucleus_complexity(halfword q, scaled * delta, int cur_styl
*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) {
diff --git a/Build/source/texk/web2c/luatexdir/tex/printing.c b/Build/source/texk/web2c/luatexdir/tex/printing.c
index c85a6a5323c..9cfca1faf28 100644
--- a/Build/source/texk/web2c/luatexdir/tex/printing.c
+++ b/Build/source/texk/web2c/luatexdir/tex/printing.c
@@ -1297,6 +1297,34 @@ void end_diagnostic(boolean blank_line)
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
diff --git a/Build/source/texk/web2c/luatexdir/tex/printing.h b/Build/source/texk/web2c/luatexdir/tex/printing.h
index e54186a2710..0d87f3d4ae7 100644
--- a/Build/source/texk/web2c/luatexdir/tex/printing.h
+++ b/Build/source/texk/web2c/luatexdir/tex/printing.h
@@ -124,6 +124,7 @@ extern void print_csnames(int hstart, int hfinish);
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;