/// <summary>
    /// Adds a Text object.
    /// </summary>
    /// <param name="text">Content of the new Text object.</param>
    /// <returns>Returns a new Text object.</returns>
    public Text AddText(string text)
    {
      if (text == null)
        throw new ArgumentNullException("text");
#if true
      Text txt = null;
      string[] lines = text.Split('\n');
      int lineCount = lines.Length;
      for (int line = 0; line < lineCount; line++)
      {
        string[] tabParts = lines[line].Split('\t');
        int count = tabParts.Length;
        for (int idx = 0; idx < count; idx++)
        {
          if (tabParts[idx].Length != 0)
          {
            txt = new Text(tabParts[idx]);
            this.Add(txt);
          }
          if (idx < count - 1)
            this.AddTab();
        }
        if (line < lineCount - 1)
          this.AddLineBreak();
      }
      return txt;
#else
      Text txt = new Text();
      txt.Content = text;
      this.Add(txt);
      return txt;
#endif
    }
Beispiel #2
0
 /// <summary>
 /// Processes a text element during formatting.
 /// </summary>
 /// <param name="text">The text element to measure.</param>
 FormatResult FormatText(Text text)
 {
   return FormatWord(text.Content);
 }
Beispiel #3
0
 void RenderText(Text text)
 {
   RenderWord(text.Content);
 }
Beispiel #4
0
 /// <summary>
 /// Adds a new Text
 /// </summary>
 public void Add(Text text)
 {
   this.Elements.Add(text);
 }
Beispiel #5
0
 internal TextRenderer(DocumentObject domObj, RtfDocumentRenderer docRenderer)
     : base(domObj, docRenderer)
 {
     this.text = domObj as Text;
 }
Beispiel #6
0
 /// <summary>
 /// Adds a new Text
 /// </summary>
 public void Add(Text text)
 {
     Elements.Add(text);
 }