[XeTeX] XeTeX 0.9999.1 released

Dohyun Kim nomosnomos at gmail.com
Thu Apr 4 04:13:46 CEST 2013

2013/4/4 Khaled Hosny <khaledhosny at eglug.org>:
> On Thu, Apr 04, 2013 at 07:34:23AM +0900, Akira Kakuto wrote:
>> Hi Khaled,
>> >One more question about vertical layout, the old XeTeX code was
>> >positioning vertical text somehow displaced on the baseline (compared to
>> >horizontal text), is this a desirable feature or a mere side effect?
>> Attached is an example created by pTeX, which is
>> known to typset vertical text beautifully.
>> Please compare XeTeX's results, by mixing usual
>> horizontal text.
> Both old a new output don't seem quite right (one is displaced upwards
> and the other is displaced downwards) unless using the built in Latin of
> the CJK fonts (in fonts that rotate Latin glyphs in vertical layout), so
> I restored the old behaviour for sake of backward compatibility. Next
> year I hope to look into the text directionality as a whole and may be
> XeTeX will get real vertical layout.

Wow! It works quite well now.  Thanks a lot.

I know from my experience that to compensate the baseline difference
between horizontal and vertical texts, moving vertical texts by 0.5ex
upwards is optimal.  But I also honor your decision to keep backward

Anyway, the only issue remaining is regarding the sign of x_offset.
To move right in real vertical mode is actually to move upwards in
xetex, so it seems that we have to reverse the plus sign of x_offset.
In fact I know a font that has vertical gpos feature using x_offset,
and this font works correctly when the following patch has been
applied.  In the same logic, it seems that the sign of x_advance
should be reversed as well.  But I am not sure as I do not have any
font to test this.

diff --git a/source/texk/web2c/xetexdir/XeTeXLayoutInterface.cpp
index 5a40eb5..c87b844 100644
--- a/source/texk/web2c/xetexdir/XeTeXLayoutInterface.cpp
+++ b/source/texk/web2c/xetexdir/XeTeXLayoutInterface.cpp
@@ -754,7 +754,7 @@ getGlyphPositions(XeTeXLayoutEngine engine, float
        if (engine->font->getLayoutDirVertical()) {
                for (i = 0; i < glyphCount; i++) {
                        positions[2*i]   = -
engine->font->unitsToPoints(x + hbPositions[i].y_offset); /* negative
is forwards */
-                       positions[2*i+1] =
engine->font->unitsToPoints(y + hbPositions[i].x_offset);
+                       positions[2*i+1] =
engine->font->unitsToPoints(y - hbPositions[i].x_offset);
                        x += hbPositions[i].y_advance;
                        y += hbPositions[i].x_advance;

Dohyun Kim

More information about the XeTeX mailing list