summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/luatexdir/tex
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/texk/web2c/luatexdir/tex')
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/commands.c1
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/dumpdata.c2
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/equivalents.h4
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/mlist.c29
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/mlist.h5
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/texnodes.c37
6 files changed, 63 insertions, 15 deletions
diff --git a/Build/source/texk/web2c/luatexdir/tex/commands.c b/Build/source/texk/web2c/luatexdir/tex/commands.c
index f78d8bb612e..261f23f4a83 100644
--- a/Build/source/texk/web2c/luatexdir/tex/commands.c
+++ b/Build/source/texk/web2c/luatexdir/tex/commands.c
@@ -175,6 +175,7 @@ void initialize_commands(void)
primitive_luatex("breakafterdirmode", assign_int_cmd, int_base + break_after_dir_mode_code, int_base);
primitive_luatex("exceptionpenalty", assign_int_cmd, int_base + exception_penalty_code, int_base);
primitive_luatex("fixupboxesmode", assign_int_cmd, int_base + fixup_boxes_code, int_base);
+ primitive_luatex("glyphdimensionsmode", assign_int_cmd, int_base + glyph_dimensions_code, int_base);
/*tex
diff --git a/Build/source/texk/web2c/luatexdir/tex/dumpdata.c b/Build/source/texk/web2c/luatexdir/tex/dumpdata.c
index fdd586afaf7..215cd686fd2 100644
--- a/Build/source/texk/web2c/luatexdir/tex/dumpdata.c
+++ b/Build/source/texk/web2c/luatexdir/tex/dumpdata.c
@@ -32,7 +32,7 @@ with LuaTeX; if not, see <http://www.gnu.org/licenses/>.
*/
-#define FORMAT_ID (907+52)
+#define FORMAT_ID (907+53)
#if ((FORMAT_ID>=0) && (FORMAT_ID<=256))
#error Wrong value for FORMAT_ID.
#endif
diff --git a/Build/source/texk/web2c/luatexdir/tex/equivalents.h b/Build/source/texk/web2c/luatexdir/tex/equivalents.h
index 3ff9ac16dbe..83117c64fa1 100644
--- a/Build/source/texk/web2c/luatexdir/tex/equivalents.h
+++ b/Build/source/texk/web2c/luatexdir/tex/equivalents.h
@@ -308,8 +308,9 @@ the |number_regs| \.{\\dimen} registers.
# define copy_lua_input_nodes_code 115
# define suppress_primitive_error_code 116
# define fixup_boxes_code 117
+# define glyph_dimensions_code 118
-# define math_option_code (suppress_primitive_error_code+1)
+# define math_option_code 119
# define mathoption_int_base_code (math_option_code+1) /* one reserve */
# define mathoption_int_last_code (mathoption_int_base_code+8)
@@ -809,6 +810,7 @@ extern halfword last_cs_name;
#define cur_font_par equiv(cur_font_loc)
#define fixup_boxes_par int_par(fixup_boxes_code)
+#define glyph_dimensions_par int_par(glyph_dimensions_code)
/* */
diff --git a/Build/source/texk/web2c/luatexdir/tex/mlist.c b/Build/source/texk/web2c/luatexdir/tex/mlist.c
index 8223df4d1a0..43db6adbbb2 100644
--- a/Build/source/texk/web2c/luatexdir/tex/mlist.c
+++ b/Build/source/texk/web2c/luatexdir/tex/mlist.c
@@ -1246,7 +1246,14 @@ static void stack_glue_into_box(pointer b, scaled min, scaled max) {
/*tex Size code corresponding to |cur_style|: */
-int cur_size;
+int cur_size = 0;
+
+/*tex A few state variables: */
+
+halfword del_height = 0;
+halfword del_depth = 0;
+halfword del_width = 0;
+halfword del_shift = 0;
static pointer get_delim_box(internal_font_number fnt, halfword chr, scaled v, scaled min_overlap, int horizontal, halfword att)
{
@@ -1538,6 +1545,20 @@ static pointer do_delimiter(pointer q, pointer d, int s, scaled v, boolean flat,
boolean do_parts = false;
boolean parts_done = false;
extinfo *ext;
+
+ if (d && ! small_fam(d) && ! large_fam(d) && ! small_char(d) && ! large_char(d)) {
+ halfword b = new_null_box();
+ subtype(b) = math_v_delimiter_list;
+ height(b) = del_height;
+ depth(b) = del_depth;
+ width(b) = del_width;
+ shift_amount(b) = del_shift;
+ node_attr(b) = node_attr(d);
+ node_attr(d) = null;
+ flush_node(d);
+ return b;
+ }
+
f = null_font;
c = 0;
if (d == null) {
@@ -1688,6 +1709,12 @@ static pointer do_delimiter(pointer q, pointer d, int s, scaled v, boolean flat,
}
DONE:
delete_attribute_ref(att);
+
+ del_height = height(b);
+ del_depth = depth(b);
+ del_width = width(b);
+ del_shift = shift_amount(b);
+
return b;
}
diff --git a/Build/source/texk/web2c/luatexdir/tex/mlist.h b/Build/source/texk/web2c/luatexdir/tex/mlist.h
index 1a15afe3c04..dc08e0cdd6f 100644
--- a/Build/source/texk/web2c/luatexdir/tex/mlist.h
+++ b/Build/source/texk/web2c/luatexdir/tex/mlist.h
@@ -24,6 +24,11 @@
extern int cur_size;
+extern halfword del_width;
+extern halfword del_height;
+extern halfword del_depth;
+extern halfword del_shift;
+
extern void run_mlist_to_hlist(halfword, boolean, int);
extern void mlist_to_hlist(halfword, boolean, int);
extern void fixup_math_parameters(int fam_id, int size_id, int f, int lvl);
diff --git a/Build/source/texk/web2c/luatexdir/tex/texnodes.c b/Build/source/texk/web2c/luatexdir/tex/texnodes.c
index 6f1a6280eee..0d7bcd5dec2 100644
--- a/Build/source/texk/web2c/luatexdir/tex/texnodes.c
+++ b/Build/source/texk/web2c/luatexdir/tex/texnodes.c
@@ -4475,7 +4475,16 @@ halfword new_char(int f, int c)
\.{\\rightghost}, respectively. They are going to be removed by
|new_ligkern|, at the end of which they are no longer needed.
- Here are a few handy helpers used by the list output routines.
+ Here are a few handy helpers used by the list output routines. The yoffset
+ has some history but we now give some control over its treatment:
+
+ 0: what we had before
+ 1: compensate height and depth
+ 2: compensate height and depth, take max
+ 3: we keep height and depth
+
+ The modes are controlled by a variable because we need to retain downward
+ compatibility.
*/
@@ -4487,20 +4496,24 @@ scaled glyph_width(halfword p)
scaled glyph_height(halfword p)
{
- scaled w = char_height(font(p), character(p)) + y_displace(p);
- if (w < 0)
- w = 0;
- return w;
+ scaled h = char_height(font(p), character(p));
+ scaled y = y_displace(p);
+ if ((glyph_dimensions_par == 0) || (glyph_dimensions_par == 1) || (glyph_dimensions_par == 2 && y > 0))
+ h += y;
+ if (h < 0)
+ h = 0;
+ return h;
}
-scaled glyph_depth(halfword p)
+scaled glyph_depth(halfword p) /* not used */
{
- scaled w = char_depth(font(p), character(p));
- if (y_displace(p) > 0)
- w = w - y_displace(p);
- if (w < 0)
- w = 0;
- return w;
+ scaled d = char_depth(font(p), character(p));
+ scaled y = y_displace(p);
+ if ((glyph_dimensions_par == 0 && y > 0) || (glyph_dimensions_par == 1) || (glyph_dimensions_par == 2 && y < 0))
+ d -= y;
+ if (d < 0)
+ d = 0;
+ return d;
}
/*tex