[XeTeX] XeTeX's (old) vbox model

Simon Cozens simon at simon-cozens.org
Wed Feb 2 20:40:56 CET 2011


Hello,
	This is a bit of an odd question, I think, but please humour me. I read from
an old mailing list message
(http://www.tug.org/pipermail/xetex/2005-March/002025.html) that XeTeX
formerly did not retrieve the height and depth of glyphs when building boxes.
I tried the code in that thread, and found that today it *is* certainly
getting those metrics - it was reporting height and depth correctly for a
range of glyphs I tried. So obviously there was a change there at some point.

	However, I'm intrigued as to how, in the past, XeTeX put together vertical
lists, given that you would need to know height and depth measurements to
apply interline glue: (from the TeXBook)

    Here are the exact rules by which TEX calculates the interline glue
    between boxes: Assume that a new box of height h (not a rule box) is
    about to be appended to the bottom of the current vertical list, and
    let \prevdepth = p, \lineskiplimit = l, \baselineskip = (b plus y
    minus z). If p <=- -1000 pt, no interline glue is added. Otherwise
    if b - p - h >= l, the interline glue `b - p - h plus y minus z)
    will be appended just above the new box. Otherwise the \lineskip
    glue will be appended. Finally, \prevdepth is set to the depth of
    the new box.

	Did it simply use a fixed height and depth per font size, essentially using a
fixed leading model? If so, how did it calculate those values? And how does it
do it now - I'm presuming it gets metrics through FreeType; does it use
control boxes (FT_Glyph_Get_CBox) or the exact bounding box? (FT_Outline_Get_BBox)

	(The reason I want to know is somewhat arcane, and somewhat embarrassing.
I've accidentally written a typesetting system, and it's a fun thing to hack
on and I want to keep toying with it. Although it's probably unnecessary, I
believe it's not totally pointless because it's embedded in a high-level
programming language and so it's very easily scriptable. And my goodness I'm
learning a lot about how TrueType/OpenType works. The slightly longer story is
at http://www.simon-cozens.org/content/typesetting-perl)

Thanks,
Simon


More information about the XeTeX mailing list