[XeTeX] XeTeX vertical text layout support (for Linux & win32 users)
jonathan_kew at sil.org
Sun Jun 18 10:22:47 CEST 2006
On 18 Jun 2006, at 7:20 am, Jjgod Jiang wrote:
> Hi Jonathan,
> Thanks for your quick update!
> 2006/6/18, Jonathan Kew <jonathan_kew at sil.org>:
>> OK, motivated by your suggestions, I've checked in a patch to
>> XeTeX_ext.c so that it recognizes the "vertical" option on opentype
>> fonts, and sets the proper flag in the XDV font_def. (The actual code
>> is a little different than your suggestion, but as you'll see, it has
>> the same effect.)
> Oh, here is the question I always want to ask, how is the
> -> loadedfontflags conversion happened? Why the underscores disappear?
> I know it happens to both variables and functions, but can't find any
> documentation say anything about this... I guess it should related
> to web2c,
> but I can only find some ``users' guide'' for web2c, none of them
> talk about
> those information developers needed to know.
You'd have to go all the way back to the original WEB system
documentation, I guess... this is a feature of TANGLE, because Pascal
doesn't (or didn't) allow underscores in identifiers, but Knuth
wanted to use them for readability in the WEB sources.
>> - the Han layout engine needs an option to apply the 'vert' feature,
>> to select alternate glyphs where appropriate
> Is there any tools I can use to check whether my fonts has this
> (any possibly, select and preview..)
I looked at FZHeiTi.ttf, one of the fonts on my SuSE machine, and it
has a 'vert' feature that substitutes 71 glyphs with alternate forms,
either rotated glyph images or with modified positioning. I looked
with FontLab; I guess FontForge would also work, or otfinfo (from
LCDF TypeTools) could tell you that the feature exists, but I don't
think it would show the actual glyphs.
I'm not aware of anything for actually demonstrating the effect in
use, though I'd guess that Far East versions of things like InDesign
probably do it.
>> - the font instance needs to return vertical instead of horizontal
>> glyph metrics, either via the usual APIs used for horizontal layout
>> (using a font instance created with a "vertical mode" flag), or by
>> providing a parallel API for vertical metrics, so that the layout
>> engine can call the appropriate methods according to the mode it's
> It seems a bit complicated for me... I guess I need some sort of
> ``XeTeX hacking guide'' to proceed.. :) Indeed, any information about
> data structures, functional separation, control flow and etc. will
> help me to understand the code more.
Sorry, there is no "hacking guide" at this time! To some extent, we'd
need an "ICU hacking guide", too, as this relates to the ICU layout
engine, as well as xetex's interface with it. But I'll try to get
something working soon, based on what I think needs to be done. Main
changes will be in XeTeXFontInst[_Linux] and XeTeXOTLayoutEngine.
Hope to have an update for you soon....
More information about the XeTeX