From ad3b0d706c71bb6f3309a236e98e8fb644121bc6 Mon Sep 17 00:00:00 2001 From: Luigi Scarso Date: Sat, 30 Jul 2022 14:48:29 +0000 Subject: [PATCH] Take exception pre/port disc font from wordstart (H.Hagen). Fixed some missed files in trunk from latest update from TexLive [[Split portion of a mixed commit.]] --- source/texk/web2c/luatexdir/ChangeLog | 3 ++ source/texk/web2c/luatexdir/lang/texlang.c | 28 +++++++++++++------ .../texk/web2c/luatexdir/luatex_svnversion.h | 2 +- 3 files changed, 24 insertions(+), 9 deletions(-) diff --git a/source/texk/web2c/luatexdir/ChangeLog b/source/texk/web2c/luatexdir/ChangeLog index 70497ad9b..f98db659a 100644 --- a/source/texk/web2c/luatexdir/ChangeLog +++ b/source/texk/web2c/luatexdir/ChangeLog @@ -1,3 +1,6 @@ +2022-07-30 Luigi Scarso + * Take exception pre/port disc font from wordstart (H.Hagen) + 2022-05-23 Luigi Scarso * Fixed mp_begin_iteration (H.Hagen) diff --git a/source/texk/web2c/luatexdir/lang/texlang.c b/source/texk/web2c/luatexdir/lang/texlang.c index 67ef25ca1..f9e53bbba 100644 --- a/source/texk/web2c/luatexdir/lang/texlang.c +++ b/source/texk/web2c/luatexdir/lang/texlang.c @@ -358,7 +358,9 @@ static halfword insert_discretionary(halfword t, halfword pre, halfword post, ha f = get_cur_font(); } for (g = pre; g != null; g = vlink(g)) { - font(g) = f; + if (! font(g)) { + font(g) = f; + } if (attr != null) { delete_attribute_ref(node_attr(g)); node_attr(g) = attr; @@ -366,7 +368,9 @@ static halfword insert_discretionary(halfword t, halfword pre, halfword post, ha } } for (g = post; g != null; g = vlink(g)) { - font(g) = f; + if (! font(g)) { + font(g) = f; + } if (attr != null) { delete_attribute_ref(node_attr(g)); node_attr(g) = attr; @@ -531,9 +535,14 @@ char *exception_strings(struct tex_language *lang) The sequence from |wordstart| to |r| can contain only normal characters it could be faster to modify a halfword pointer and return an integer + We now take the font from the wordstart (as in \LUAMETATEX) but leave the + rest as it is, because we don't want to break compatibility (end June 2022). + We make a copy now of the parent and hope for the best. Backporting would be + too intrusive so this has to do. It went unnoticed for ages anyway. + */ -static halfword find_exception_part(unsigned int *j, unsigned int *uword, int len) +static halfword find_exception_part(unsigned int *j, unsigned int *uword, int len, halfword parent) { halfword g = null, gg = null; register unsigned i = *j; @@ -541,13 +550,16 @@ static halfword find_exception_part(unsigned int *j, unsigned int *uword, int le i++; while (i < (unsigned) len && uword[i + 1] != '}') { if (g == null) { - gg = new_char(0, (int) uword[i + 1]); + /* gg = new_char(font(parent), (int) uword[i + 1]); */ + gg = copy_node(parent); g = gg; } else { - halfword s = new_char(0, (int) uword[i + 1]); + /* halfword s = new_char(font(parent), (int) uword[i + 1]); */ + halfword s = copy_node(parent); couple_nodes(g, s); - g = vlink(g); + g = s; } + character(g) = (int) uword[i + 1]; i++; } *j = ++i; @@ -614,12 +626,12 @@ static void do_exception(halfword wordstart, halfword r, char *replacement) halfword gg, hh, replace = null; int repl; /*tex |pre| */ - gg = find_exception_part(&i, uword, (int) len); + gg = find_exception_part(&i, uword, (int) len, wordstart); if (i == len || uword[i + 1] != '{') { tex_error("broken pattern 1", PAT_ERROR); } /*tex |post| */ - hh = find_exception_part(&i, uword, (int) len); + hh = find_exception_part(&i, uword, (int) len, wordstart); if (i == len || uword[i + 1] != '{') { tex_error("broken pattern 2", PAT_ERROR); } diff --git a/source/texk/web2c/luatexdir/luatex_svnversion.h b/source/texk/web2c/luatexdir/luatex_svnversion.h index a7074e352..50224b636 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 7530 +#define luatex_svn_revision 7531 #endif