[XeTeX] XeTeX vertical text layout support (for Linux & win32 users)
gzjjgod at gmail.com
Sun Jun 18 08:20:15 CEST 2006
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 loaded_font_flags
-> 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.
> The remaining (and harder) issue is that the actual measurement of
> text will ignore this setting, and still use the horizontal metrics.
> The ICU layout engine does not currently support vertical layout, or
> the application of the opentype 'vert' feature in Han script, so
> there's some groundwork to be done before this will actually work
> properly. In brief:
> - 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 feature?
(any possibly, select and preview..)
> - 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.
> I've also checked in a patch to xdvipdfmx to respect the vertical
> flag in the native_font_def. I did this at the pdf_dev_locate_font
> level, rather than the fontmap, to avoid the problem mentioned above;
> so there's only a single fontmap entry for a font, whether used in H
> or V mode or both; but dvi_locate_native_font passes the layout
> direction to pdf_dev_locate_font, and it then overrides the Identity-
> H mapping name if necessary.
It's nicer than my code. I'll spend some time to test this code
and see if it really works.
More information about the XeTeX