PrintDocument for WinForms
RenderVerticalText クラス
メンバ  使用例 


C1.PrintDocument.6 アセンブリ > C1.C1Preview 名前空間 : RenderVerticalText クラス
Represents a run of vertical text in a C1PrintDocument.

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).

オブジェクト モデル
RenderVerticalText クラス
シンタックス
'宣言
 
Public Class RenderVerticalText 
   Inherits RenderText
   Implements IDocumentLocationIStyleOwner 
'使用法
 
Dim instance As RenderVerticalText
public class RenderVerticalText : RenderText, IDocumentLocationIStyleOwner  
解説

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.

使用例
The code below prints "CASINO ROYAL" and digits "12345" vertically:
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;
}
継承階層

System.Object
   C1.C1Preview.RenderObject
      C1.C1Preview.RenderTextBase
         C1.C1Preview.RenderText
            C1.C1Preview.RenderVerticalText

参照

RenderVerticalText メンバ
C1.C1Preview 名前空間
RenderVerticalParagraph クラス