summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/luatexdir/tex/texnodes.c
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/texk/web2c/luatexdir/tex/texnodes.c')
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/texnodes.c37
1 files changed, 25 insertions, 12 deletions
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