[XeTeX] Access of vertical CJK fonts preceeding with @

Adam Twardoch (List) list.adam at twardoch.com
Fri Dec 7 00:48:48 CET 2012

I think proper vertical writing mode would be best, without resorting to multiple rotations :)

Yes, the "vert" is used for punctuation but also for Latin glyphs, which are often proportional in "height" (ie. avtually "rotated width"). "vert" is typically used in combination with "vkrn", which then does vertical kerning. So if toy have the text "Typeface" set in a CJK font vertically, the "vert" feature would map the glyphs T, y, p, o, g etc. to their counterparts which are rotated by 90 deg to the right, and then the "vkrn" feature would move the rotated "y" up if following a rotated "T" -- by the same amount as the normal "Ty" kerning pair.

Of course not all CJK fonts include rotated Latin glyphs, let alone proportional, and let alone with vertical kerning. But some do (especially Adobe's Japanese fonts).

There is another set of features (fwid, pwid, hwid -- AFAIR) which switch Latin glyphs and punctuation between full-width (monospaced), proportional (normal from the European perspective) and half-width (narrow monospaced) variants. Using them is up to the user's preference and discretion. Some but not all fonts provide rotated forms for all these variants as well.

But all this stuff is made to work with the "true" vertical typesetting direction in mind, and has to do with things that happen within the line. 

Stuff that happens on the higher level, i.e. by which means you actually get entire lines to be laid out in the vertical direction, is a wholly another level.

As I mentioned, the "@" hack is just a Windows API trick -- these special fonts don't really exist, they're being synthetically generated by the Windows API and are exposed to apps that use the Windows API to do text layout and rendering.

But XeTeX accesses font files more directly, and directly parses OpenType Layout tables, so the "@" trick shouldn't work since these are not "real" fonts.

And, as I said at the beginning, I think proper vertical writing mode in XeTeX would be the *real* solution, without resorting to OS API tricks. 

However, I'm not at all a TeX expert so I don't know which options are available. 


Sent from my mobile phone.

On 07.12.2012, at 00:03, Gerrit <z0idberg at gmx.de> wrote:

> Hello Adam,
> thanks for you answer. I didn’t know that the @ thing is a Windows feature. Well then I guess it does not work.
> I just wondered if it might be an easy and actually good way to create vertical Japanese texts (not just a paragraph or a text box, but the entire document): Everything like columns, page break, sections etc. would work flawlessly . Incorporating Western text in the text would also work without any problems.
> Basically I just thought about using the @ font, rotating the entire page 90° clockwise (so that the text is vertically and the alignment is correct), flipping the width and height size of the paper, so that a portrait paper stays a portrait paper, and then       the text would work.
> Horizontally written picture boxes/captions or tables etc. could be done with the normal rotating package (i.e., rotating them back). The only problem would maybe be the head and foot, because the rotated page would then have the head and foot on the right and left side, resp. But I thought about tackling that issue afterwords. Either way, I just wanted to try it out.
> Rotating every glyph independently (like it is done in the xetex manual) does not seem to be that suitable for longer texts, and you would have to cope with many many many packages and other problems. 
> As far as I understood the vert feature, it works for rotating stuff like the colon (ten), the full stop (maru), brackets etc. A normal character would not have to be rotated. This is then necessary if you actually do it for rotating every single glyph, but not if the entire text becomes rotated and you basically just rotate the page backwards.
> I actually really think that something like the @ thing would be the easiest way to implement vertical typeset into Xetex.
> Gerrit
> Am 06.12.2012 23:48, schrieb Adam Twardoch (List):
>> Gerrit,
>> this is a custom functionality of the Windows API, a "poor man's" method to get vertical typesetting in "normal" applications which cannot deal with real vertical typesetting. The "vert" feature is different: it provides additional 90 degree rotation for those glyphs which are read better in a horizontal arrangement rotated by 90 degrees. I.e. you use the "vert" feature in a *real* vertcal typesetting context where CJK glyphs occur one under the other, but e.g. for Latin glyphs it makes sense to set them so that the reader has to turn his head to the right. 
>> So "vert" is completely independent of what you're asking. If XeTeX cannot do "proper" vertical typesetting then perhaps indeed there should be a font selection function that just rotates everything set in that font. I'd rather have such a mechanism exposed than to rely on a non-cross-platform "@" prefix "OS hack" (a hack actually provided by the OS). I don't know whether such mechanism already exists in XeTeX though. Perhaps it does?
>> Either way, you'd still want to apply the "vert" feature to do additional 90 degree rotation for certain glyphs, or -- if used in the scenario you're proposing -- to actually *un-rotate* them, so they bacome horizontal again. 
>> A.
> --------------------------------------------------
> Subscriptions, Archive, and List information, etc.:
>  http://tug.org/mailman/listinfo/xetex
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/xetex/attachments/20121207/87217a92/attachment-0001.html>

More information about the XeTeX mailing list