diff --git a/source/texk/web2c/luatexdir/ChangeLog b/source/texk/web2c/luatexdir/ChangeLog index 70497ad9bfef52c96a96f79076e423eb95ef2e22..f98db659a804ef68c24a85611a53c1c02384d2fb 100644 --- a/source/texk/web2c/luatexdir/ChangeLog +++ b/source/texk/web2c/luatexdir/ChangeLog @@ -1,3 +1,6 @@ +2022-07-30 Luigi Scarso <luigi.scarso@gmail.com> + * Take exception pre/port disc font from wordstart (H.Hagen) + 2022-05-23 Luigi Scarso <luigi.scarso@gmail.com> * 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 67ef25ca1d1b5687c5402bdcefd0e0f40d09e715..f9e53bbbabf4ba4c6ae8e377419b7760f9f00ebf 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 a7074e3525d6a55379e104c67907bc4f3519bd0b..50224b636a6f9a70bc34bb2339ae20d21fe8adc8 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