From aff8cf6c52a5cf470b600e0d5898446af7b313d0 Mon Sep 17 00:00:00 2001 From: Akira Kakuto Date: Sat, 19 Dec 2015 04:43:01 +0000 Subject: web2c/luatexdir: sync with the upstream git-svn-id: svn://tug.org/texlive/trunk@39146 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/web2c/luatexdir/pdf/pdfgen.w | 2 +- Build/source/texk/web2c/luatexdir/tex/mathcodes.w | 4 ++- Build/source/texk/web2c/luatexdir/tex/texmath.w | 34 +++++++++++++++------- .../source/texk/web2c/luatexdir/utils/managed-sa.w | 4 +-- 4 files changed, 30 insertions(+), 14 deletions(-) (limited to 'Build/source/texk') diff --git a/Build/source/texk/web2c/luatexdir/pdf/pdfgen.w b/Build/source/texk/web2c/luatexdir/pdf/pdfgen.w index 94bfbaddcbf..1762600ccd6 100644 --- a/Build/source/texk/web2c/luatexdir/pdf/pdfgen.w +++ b/Build/source/texk/web2c/luatexdir/pdf/pdfgen.w @@ -913,7 +913,7 @@ static void init_pdf_outputparameters(PDF pdf) int pk_mode; pdf->draftmode = fix_int(int_par(draft_mode_code), 0, 1); pdf->compress_level = fix_int(pdf_compress_level, 0, 9); - pdf->decimal_digits = fix_int(pdf_decimal_digits, 0, 4); + pdf->decimal_digits = fix_int(pdf_decimal_digits, 3, 16); pdf->gamma = fix_int(pdf_gamma, 0, 1000000); pdf->image_gamma = fix_int(pdf_image_gamma, 0, 1000000); pdf->image_hicolor = fix_int(pdf_image_hicolor, 0, 1); diff --git a/Build/source/texk/web2c/luatexdir/tex/mathcodes.w b/Build/source/texk/web2c/luatexdir/tex/mathcodes.w index 062e271055a..4acd887eace 100644 --- a/Build/source/texk/web2c/luatexdir/tex/mathcodes.w +++ b/Build/source/texk/web2c/luatexdir/tex/mathcodes.w @@ -304,7 +304,9 @@ int get_del_code_num(int n) static void initializedelcode(void) { sa_tree_item sa_value = { 0 }; - sa_value.uint_value = DELCODEDEFAULT; + /* sa_value.uint_value = DELCODEDEFAULT; */ + sa_value.dump_uint.value_1 = DELCODEDEFAULT; + sa_value.dump_uint.value_2 = 0; delcode_head = new_sa_tree(DELCODESTACK, 2, sa_value); } diff --git a/Build/source/texk/web2c/luatexdir/tex/texmath.w b/Build/source/texk/web2c/luatexdir/tex/texmath.w index 16224f09ff0..661830bb16c 100644 --- a/Build/source/texk/web2c/luatexdir/tex/texmath.w +++ b/Build/source/texk/web2c/luatexdir/tex/texmath.w @@ -1191,17 +1191,31 @@ mathcodeval scan_mathchar(int extcode) /* "TFCC */ scan_int(); if (cur_val > 0x8000) { - tex_error("Invalid math code", hlp); - cur_val = 0; - } - if (cur_val < 0) { - snprintf(errstr, 255, "Bad mathchar (%d)", (int)cur_val); - tex_error(errstr, hlp); - cur_val = 0; + /* + tex_error("Invalid math code", hlp); + cur_val = 0; + */ + /* needed for latex: fallback to umathnum_mathcode */ + mfam = (cur_val / 0x200000) & 0x7FF; + mcls = mfam % 0x08; + mfam = mfam / 0x08; + mchr = cur_val & 0x1FFFFF; + if (mchr > 0x10FFFF) { + tex_error("Invalid math code during > 0x8000 mathcode fallback", hlp); + mcls = 0; + mfam = 0; + mchr = 0; + } + } else { + if (cur_val < 0) { + snprintf(errstr, 255, "Bad mathchar (%d)", (int)cur_val); + tex_error(errstr, hlp); + cur_val = 0; + } + mcls = (cur_val / 0x1000); + mfam = ((cur_val % 0x1000) / 0x100); + mchr = (cur_val % 0x100); } - mcls = (cur_val / 0x1000); - mfam = ((cur_val % 0x1000) / 0x100); - mchr = (cur_val % 0x100); } else if (extcode == umath_mathcode) { /* <0-0x7> <0-0xFF> <0-0x10FFFF> */ scan_int(); diff --git a/Build/source/texk/web2c/luatexdir/utils/managed-sa.w b/Build/source/texk/web2c/luatexdir/utils/managed-sa.w index 857b2d42e9f..1be36eeb834 100644 --- a/Build/source/texk/web2c/luatexdir/utils/managed-sa.w +++ b/Build/source/texk/web2c/luatexdir/utils/managed-sa.w @@ -231,7 +231,7 @@ void dump_sa_tree(sa_tree a) for (l = 0; l < LOWPART; l++) { x = a->tree[h][m][l].dump_uint.value_1; dump_int(x); - if (n == 1) { + if (n == 2) { x = a->tree[h][m][l].dump_uint.value_2; dump_int(x); } @@ -283,7 +283,7 @@ sa_tree undump_sa_tree(void) for (l = 0; l < LOWPART; l++) { undump_int(x); a->tree[h][m][l].dump_uint.value_1 = x; - if (n == 1) { + if (n == 2) { undump_int(x); a->tree[h][m][l].dump_uint.value_2 = x; } -- cgit v1.2.3