Hi,

I found a curiosity in LuaTeX's treatment of `y_displacement` in glyph
nodes:

Take the following ConTeXt example:

\usetypescript[pagella]
\setupbodyfont[pagella,12pt]
\starttext
f\char776\char776\char776\char807\char807\char807\vrule
\stoptext

(See https://github.com/latex3/luaotfload/issues/134 for a more
practical case where this leads to issues)

Here the \vrule shows that the marks attached at the top get their
y_displacement added to their height, while for the marks added at
the bottom the additional depth is ignored. (The first \char807 is
still covered by the rule because that is the natural height of this
glyph)

This is explicitly done in texnodes.c: For glyph_height, the
displacement is always added. For glyph_depth, the displacement is only
added if it is positive:

  scaled glyph_height(halfword p)
  {
      scaled w = char_height(font(p), character(p)) + y_displace(p);
      if (w < 0)
          w = 0;
      return w;
  }
  
  scaled glyph_depth(halfword p)
  {
      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;
  }

This seems inconsistant. Is there a reason why this would be required or
could it be changed to handle height and depth consistently?

Best regards,
Marcel
_______________________________________________
dev-luatex mailing list
dev-luatex@ntg.nl
https://mailman.ntg.nl/mailman/listinfo/dev-luatex

Reply via email to