The attached patch fixes the most glaring errors, the positioning is
still not quite right, and after many hours of attempting to fix it I'm
more confused than ever, I really don't know what is going on.

Regards,
Khaled

On Fri, Mar 29, 2013 at 09:58:28PM +0200, Khaled Hosny wrote:
> This looks very bad! It weren't like that last time I tested vertical
> layout (which was fairly recently), I'll see what got broken.
> 
> Regards,
> Khaled
> 
> On Thu, Mar 28, 2013 at 07:52:30PM +0900, Dohyun Kim wrote:
> > Attached is my tex file for test.  "Adobe Myungjo Std" used in this
> > file is a font bundled with Korean version of Adobe Reader.  If you do
> > not have this font, replace it with any other cjk font which has vrt2
> > feature, such as Kozuka Mincho.
> > 
> > Best,
> > 
> > 
> > 2013/3/28 Khaled Hosny <[email protected]>:
> > > On Thu, Mar 28, 2013 at 10:29:35AM +0900, Dohyun Kim wrote:
> > >> Hi,
> > >>
> > >> "vertical" option of XeTeX 0.9999 is currently broken.  Applying
> > >> attached patch seems to make it work better, though I know almost
> > >> nothing about C language.
> > >
> > > I appreaciate if you have test files for me to try, I had hard time
> > > figuring how to test this since most CJK fonts that I have give funny
> > > results even with old XeTeX.
> > >
> > > Regards,
> > >
> > >> Still, some issue remains.  Especially vertical gpos feature, for
> > >> instance +vhal option, does not work correctly.  Though vhal feature
> > >> should decrease the glyph advance, current XeTeX increases it instead.
> > >>  Harfbuzz, on the other hand, works correctly.  I could not figure out
> > >> where this problem comes from.
> > >
> > > Tests for this are welcome, too.
> > >
> > > Regards,
> > > Khaled
> > >
> > >
> > > --------------------------------------------------
> > > Subscriptions, Archive, and List information, etc.:
> > >   http://tug.org/mailman/listinfo/xetex
> > 
> > 
> > 
> > -- 
> > Dohyun Kim
> > College of Law, Dongguk University
> > Seoul, Republic of Korea
> 
> 
> > 
> > 
> > --------------------------------------------------
> > Subscriptions, Archive, and List information, etc.:
> >   http://tug.org/mailman/listinfo/xetex
> 
>From e02fa378389d7060347a314e343538be933408cb Mon Sep 17 00:00:00 2001
From: Khaled Hosny <[email protected]>
Date: Sat, 30 Mar 2013 00:09:53 +0200
Subject: [PATCH] Fix vertical layout

* Really pass FT_LOAD_VERTICAL_LAYOUT to FT_Get_Advance()
* Negate the value returned by it
---
 source/texk/web2c/xetexdir/XeTeXFontInst.cpp |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/source/texk/web2c/xetexdir/XeTeXFontInst.cpp b/source/texk/web2c/xetexdir/XeTeXFontInst.cpp
index 218843c..676759a 100644
--- a/source/texk/web2c/xetexdir/XeTeXFontInst.cpp
+++ b/source/texk/web2c/xetexdir/XeTeXFontInst.cpp
@@ -106,12 +106,16 @@ _get_glyph_advance(FT_Face face, FT_UInt gid, bool vertical)
 	if (vertical)
 		flags |= FT_LOAD_VERTICAL_LAYOUT;
 
-	error = FT_Get_Advance(face, gid, ftLoadFlags, &advance);
+	error = FT_Get_Advance(face, gid, flags, &advance);
 	if (error)
 		advance = 0;
 	else
 		advance = advance >> 10;
 
+	/* FreeType's vertical metrics grows downward */
+	if (vertical)
+		advance = -advance;
+
 	return advance;
 }
 
-- 
1.7.9.5


--------------------------------------------------
Subscriptions, Archive, and List information, etc.:
  http://tug.org/mailman/listinfo/xetex

Reply via email to