[]
        
(Showing Draft Content)

TextFormatInfo

Class TextFormatInfo

java.lang.Object
com.grapecity.documents.excel.TextFormatInfo

public class TextFormatInfo extends Object
Describes font and layout options for drawing text.

Use this class to supply text formatting information such as font family, font size, bold, and italic settings when custom graphics logic needs to measure or render text. It is used by APIs such as IGraphicsInfo.getDigitWidth(TextFormatInfo).


 TextFormatInfo textFormat = new TextFormatInfo();
 textFormat.setFontFamily("Calibri");
 textFormat.setFontSize(11);
 textFormat.setBold(true);
 textFormat.setItalic(false);
 
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Gets the top-level font weight for the content of the element.
    final String
    Gets the font family used for drawing text.
    final double
    Gets the desired font size to use in points.
    final boolean
    Gets the font style for the content of the element.
    final void
    setBold(boolean value)
    Sets the top-level font weight for the content of the element.
    final void
    Sets the font family used for drawing text.
    final void
    setFontSize(double value)
    Sets the desired font size to use in points.
    final void
    setItalic(boolean value)
    Sets the font style for the content of the element.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • TextFormatInfo

      public TextFormatInfo()
  • Method Details

    • getFontFamily

      public final String getFontFamily()
      Gets the font family used for drawing text.

      Returns the family name previously assigned by setFontFamily(String).

      
       TextFormatInfo textFormat = new TextFormatInfo();
       textFormat.setFontFamily("Calibri");
       String fontFamily = textFormat.getFontFamily();
       
      Returns:
      The font family name, or null if no font family has been set.
    • setFontFamily

      public final void setFontFamily(String value)
      Sets the font family used for drawing text.

      Use this method to specify the family name that custom graphics logic should use when measuring or rendering text.

      
       TextFormatInfo textFormat = new TextFormatInfo();
       textFormat.setFontFamily("Calibri");
       
      Parameters:
      value - The font family name, or null if no font family has been set.
    • getFontSize

      public final double getFontSize()
      Gets the desired font size to use in points.

      Returns the font size previously assigned by setFontSize(double).

      
       TextFormatInfo textFormat = new TextFormatInfo();
       textFormat.setFontSize(11);
       double fontSize = textFormat.getFontSize();
       
      Returns:
      The desired font size, in points.
    • setFontSize

      public final void setFontSize(double value)
      Sets the desired font size to use in points.

      Use this method to specify the font size, in points, that custom graphics logic should use when measuring or rendering text.

      
       TextFormatInfo textFormat = new TextFormatInfo();
       textFormat.setFontSize(11);
       
      Parameters:
      value - The desired font size, in points.
    • getBold

      public final boolean getBold()
      Gets the top-level font weight for the content of the element.

      Returns true if the font weight is bold (700). Otherwise, returns false when the font weight is normal or regular (400).

      
       TextFormatInfo textFormat = new TextFormatInfo();
       textFormat.setBold(true);
       boolean bold = textFormat.getBold();
       
      Returns:
      true if the font weight is bold (700); otherwise, false.
    • setBold

      public final void setBold(boolean value)
      Sets the top-level font weight for the content of the element.

      Use this method to specify whether the text should use a bold font weight. Set true for bold text or false for normal text.

      
       TextFormatInfo textFormat = new TextFormatInfo();
       textFormat.setBold(true);
       
      Parameters:
      value - true if the font weight is bold (700); otherwise, false.
    • getItalic

      public final boolean getItalic()
      Gets the font style for the content of the element.

      Returns the italic setting previously assigned by setItalic(boolean). If this method returns true, the font style is italic; otherwise, the font style is normal.

      
       TextFormatInfo textFormat = new TextFormatInfo();
       textFormat.setItalic(true);
       boolean italic = textFormat.getItalic();
       
      Returns:
      true if the font style is italic; otherwise, false.
    • setItalic

      public final void setItalic(boolean value)
      Sets the font style for the content of the element.

      Use this method to specify whether the text should use italic styling.

      
       TextFormatInfo textFormat = new TextFormatInfo();
       textFormat.setItalic(true);
       
      Parameters:
      value - true if the font style is italic; otherwise, false.