[XeTeX] fontspec and vertical writing with ICU layout
Jonathan Kew
jonathan_kew at sil.org
Thu Apr 5 11:55:50 CEST 2007
On 5 Apr 2007, at 1:23 am, caapv 208 wrote:
> I wrote:
>
>> But how can I typeset vertical text with fontspec.
>> I have tried the RawFeature, but only the second
>> example
>> works:
>>
>> \documentclass{article}
>> \usepackage{graphics,fontspec}
>> \begin{document}
>> \setmainfont[Script=Kana,RawFeature=vertical]{Kozuka
>> Mincho Pro}
>> \rotatebox{-90}{紅玉}
>> \font\f="Kozuka Mincho Pro:script=kana,vertical"
>> \f\rotatebox{-90}{紅玉}
>> \end{document}
>>
>> RawFeature={script=kana,vertical} doesn't work
>> either.
>
> I think I got it for the ICU layout. I haven't
> looked into the AAT question raised by Jjgod, though.
> In the while() loop in
>
> static void*
> loadOTfont(PlatformFontRef fontRef, XeTeXFont font, Fixed
> scaled_size, const char* cp1)
>
> the statement
> goto next_option;
> is nested one step deeper for "vertical" than for
> other options. Jonathan, is this correct?
Yes, that looks OK; however, on inspecting the code I see that it can
be overly picky; it won't recognize the "vertical" option if it
occurs at the end of the list of features, and has a trailing space
afterwards (although the code was intended to ignore trailing spaces,
and does so in other cases). This leads to a problem because I think
fontspec tends to put spaces into \font command it creates.
> So a workaround for the current codebase is to put
> either ':' or ';' at the end of "vertical".
> Both
> [Script=Kana,RawFeature=vertical:]
> and
> [RawFeature={script=kana,vertical:}]
> work with fontspec v1.13a, and there seems no need
> for me to keep v1.10 around anymore.
I have just patched the code so that it will properly ignore trailing
spaces on this option. Another workaround for the current xetex and
fontspec code should be to move the "vertical" option to non-final
position in the list, e.g.,
RawFeature={vertical;script=kana}
should work.
Sorry for the hassle!
JK
More information about the XeTeX
mailing list