SetVerticalWritingMode
Text
Description
Sets text to run down the page instead of across it
Syntax
Delphi
Function TPDFlib.SetVerticalWritingMode(Mode: Integer): Integer;Parameters
| Mode | 1 sets text downwards, 0 across the page |
|---|
Return values
| Mode | The mode that was in force before this call |
|---|
Remarks
Japanese and Chinese are commonly set down the page, right column to left. With this mode on, DrawText starts at the given point and runs downwards
Text drawn this way goes through a Type0 font in vertical writing mode carrying the face's own vertical metrics, so each character advances by the distance its designer intended and copying the text out of the finished document returns the original characters. A face carrying no vertical metrics advances one em per character
Characters that are drawn differently down the page - brackets, the long vowel mark, the small kana - are drawn in the vertical form the face itself names, so each face supplies what its designer drew
Where the platform shaping engine is not available, the selected font must be an embedded TrueType or OpenType font, whose own program supplies the glyphs and their vertical forms
The horizontal and vertical forms of one face are separate fonts in the document, so a page can carry both. The mode belongs to the library instance, not to a document
Example
PDF.AddTrueTypeFont('MS Gothic {128}', 1);
PDF.SetTextSize(24);
PDF.SetVerticalWritingMode(1);
PDF.DrawText(400, 700, Text); // runs down from (400, 700)
PDF.SetVerticalWritingMode(0); // back to running acrossSee also
GetVerticalWritingMode, DrawVerticalText, GetVerticalTextHeight, SetTextShaping