Microsoft SDK for Java

Vertical Writing Support

Traditional Chinese and Japanese texts are written vertically. Characters appear in a vertical line from the top to the bottom of the page, with lines progressing from the right to the left side of the page. The Microsoft VM supports vertical writing with the FxFormattedText class. There are two ways to specify that the text for an FxFormattedText buffer be written vertically:

Example

The following sample code implements a panel that contains vertical writing:

class VerticalWritingSample extends UIPanel
{
    FxFormattedText fxft;

    public VerticalWritingSample ()
    {
        fxft = new FxFormattedText ("Vertical Text!");
        fxft.setLocale (Locale.JAPANESE_VERTICAL);
    }

    public void paint (FxGraphics g)
    {
        fxft.paint (g);
    }
}

Note   When written vertically, characters are rotated 90 degrees to the right (clockwise). This rotation is in accordance with the conventions of vertical writing for traditional Chinese and Japanese texts.

© 1999 Microsoft Corporation. All rights reserved. Terms of use.