/**
  *  Add a new text line.
  *
  *  Find the current font, current size and effects (normal, super or subscript)
  *  Set the position of the component to the starting stored as current position
  *  Set the size and offset based on effects
  *  Set the new current position
  *
  *  @param component the component.
  */
 public void AddComponent(TextLine component)
 {
     if (component.GetTextEffect() == Effect.SUPERSCRIPT)
     {
         if (fontSize > 0f)
         {
             component.GetFont().SetSize(fontSize * superscript_size_factor);
         }
         component.SetLocation(
             current[X],
             current[Y] - fontSize * superscript_position);
     }
     else if (component.GetTextEffect() == Effect.SUBSCRIPT)
     {
         if (fontSize > 0f)
         {
             component.GetFont().SetSize(fontSize * subscript_size_factor);
         }
         component.SetLocation(
             current[X],
             current[Y] + fontSize * subscript_position);
     }
     else
     {
         if (fontSize > 0f)
         {
             component.GetFont().SetSize(fontSize);
         }
         component.SetLocation(current[X], current[Y]);
     }
     current[X] += component.GetWidth();
     textLines.Add(component);
 }
Ejemplo n.º 2
0
 public void AddComponent(TextLine component)
 {
     if (component.GetTextEffect() == 2)
     {
         component.GetFont().SetSize(this.fontSize * this.superscript_size_factor);
         component.SetPosition(this.current[0], this.current[1] - this.fontSize * this.superscript_position);
     }
     else
     {
         if (component.GetTextEffect() == 1)
         {
             component.GetFont().SetSize(this.fontSize * this.subscript_size_factor);
             component.SetPosition(this.current[0], this.current[1] + this.fontSize * this.subscript_position);
         }
         else
         {
             component.GetFont().SetSize(this.fontSize);
             component.SetPosition(this.current[0], this.current[1]);
         }
     }
     this.current[0] += (double)component.GetWidth();
     this.textLines.Add(component);
 }
Ejemplo n.º 3
0
 /**
  *  Add a new text line.
  *
  *  Find the current font, current size and effects (normal, super or subscript)
  *  Set the position of the component to the starting stored as current position
  *  Set the size and offset based on effects
  *  Set the new current position
  *
  *  @param component the component.
  */
 public void AddComponent(TextLine component)
 {
     if (component.GetTextEffect() == Effect.SUPERSCRIPT) {
     component.GetFont().SetSize(fontSize * superscript_size_factor);
     component.SetPosition(
             current[X],
             current[Y] - fontSize * superscript_position);
     }
     else if (component.GetTextEffect() == Effect.SUBSCRIPT) {
     component.GetFont().SetSize(fontSize * subscript_size_factor);
     component.SetPosition(
             current[X],
             current[Y] + fontSize * subscript_position);
     }
     else {
     component.GetFont().SetSize(fontSize);
     component.SetPosition(current[X], current[Y]);
     }
     current[X] += component.GetWidth();
     textLines.Add(component);
 }