Designed primarily for rendering of Asian (e.g. Japanese) text in the traditional manner, vertically from right to left.
Text is drawn using a single style (see RenderVerticalParagraph for multi-style text).
Assembly: C1.C1Report.2 (in C1.C1Report.2.dll)
Syntax
C# |
---|
public class RenderVerticalText : RenderText |
Visual Basic |
---|
Public Class RenderVerticalText _ Inherits RenderText |
Remarks
The default height and width of RenderVerticalText is auto. In particular, that means that text without line breaks will by default stretch downwards indefinitely. To make text wrap at the bottom, the height of the RenderVerticalText object must be explicitly set.
Note that while the main use of this class is to output text in Asian languages, you can also print English text in this manner. To do so, add hex code 0xFEE0 to each English letter.
Examples
private static string ToVertical(string s) { StringBuilder sb = new StringBuilder(s.Length); for (int i = 0; i < s.Length; i++) if (s[i] == ' ') sb.Append(s[i]); else sb.Append((char)((int)s[i] + (0xFF10 - (int)'0'))); return sb.ToString(); } private C1PrintDocument CreateDocument() { C1PrintDocument doc = new C1PrintDocument(); doc.FontHandling = FontHandling.EmbedActualFonts; RenderVerticalText rt; rt = new RenderVerticalText(); rt.Style.Borders.All = LineDef.Default; rt.Style.Font = new Font("Arial", 18); rt.Text = ToVertical("CASINO ROYAL"); doc.Body.Children.Add(rt); rt = new RenderVerticalText(); rt.Style.Borders.All = LineDef.Default; rt.Style.Font = new Font("Arial", 18); rt.Text = ToVertical("Digits: (12345)"); doc.Body.Children.Add(rt); return doc; } |
Inheritance Hierarchy
C1.C1Preview..::..RenderObject
C1.C1Preview..::..RenderTextBase
C1.C1Preview..::..RenderText
C1.C1Preview..::..RenderVerticalText