Interface Font

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static byte ANSI_CHARSET
      ANSI character set
      static short COLOR_NORMAL
      normal type of black color.
      static short COLOR_RED
      Dark Red color
      static byte DEFAULT_CHARSET
      Default character set.
      static short SS_NONE
      no type offsetting (not super or subscript)
      static short SS_SUB
      subscript
      static short SS_SUPER
      superscript
      static byte SYMBOL_CHARSET
      Symbol character set
      static int TWIPS_PER_POINT
      Font height is handled in points and 1/20th of points so this is the constant used to convert between those two units.
      static byte U_DOUBLE
      double underlined
      static byte U_DOUBLE_ACCOUNTING
      accounting style double underline
      static byte U_NONE
      not underlined
      static byte U_SINGLE
      single (normal) underline
      static byte U_SINGLE_ACCOUNTING
      accounting style single underline
    • Method Detail

      • setFontName

        void setFontName​(java.lang.String name)
        set the name for the font (i.e. Arial)
        Parameters:
        name - String representing the name of the font to use
      • getFontName

        java.lang.String getFontName()
        get the name for the font (i.e. Arial)
        Returns:
        String representing the name of the font to use
      • setFontHeight

        void setFontHeight​(short height)
        set the font height in unit's of 1/20th of a point. Maybe you might want to use the setFontHeightInPoints which matches to the familiar 10, 12, 14 etc..
        Parameters:
        height - height in 1/20ths of a point
        See Also:
        setFontHeightInPoints(short)
      • setFontHeightInPoints

        void setFontHeightInPoints​(short height)
        set the font height
        Parameters:
        height - height in the familiar unit of measure - points
        See Also:
        setFontHeight(short)
      • getFontHeight

        short getFontHeight()
        Get the font height in unit's of 1/20th of a point.

        For many users, the related getFontHeightInPoints() will be more helpful, as that returns font heights in the more familiar points units, eg 10, 12, 14.

        Returns:
        short - height in 1/20ths of a point
        See Also:
        getFontHeightInPoints()
      • getFontHeightInPoints

        short getFontHeightInPoints()
        Get the font height in points.

        This will return the same font height that is shown in Excel, such as 10 or 14 or 28.

        Returns:
        short - height in the familiar unit of measure - points
        See Also:
        getFontHeight()
      • setItalic

        void setItalic​(boolean italic)
        set whether to use italics or not
        Parameters:
        italic - italics or not
      • getItalic

        boolean getItalic()
        get whether to use italics or not
        Returns:
        italics or not
      • setStrikeout

        void setStrikeout​(boolean strikeout)
        set whether to use a strikeout horizontal line through the text or not
        Parameters:
        strikeout - or not
      • getStrikeout

        boolean getStrikeout()
        get whether to use a strikeout horizontal line through the text or not
        Returns:
        strikeout or not
      • setTypeOffset

        void setTypeOffset​(short offset)
        set normal,super or subscript.
        Parameters:
        offset - type to use (none,super,sub)
        See Also:
        SS_NONE, SS_SUPER, SS_SUB
      • getTypeOffset

        short getTypeOffset()
        get normal,super or subscript.
        Returns:
        offset type to use (none,super,sub)
        See Also:
        SS_NONE, SS_SUPER, SS_SUB
      • getIndex

        int getIndex()
        get the index within the XSSFWorkbook (sequence within the collection of Font objects)
        Returns:
        unique index number of the underlying record this Font represents (probably you don't care unless you're comparing which one is which)
        Since:
        5.0.0 (used to return a short)
      • getIndexAsInt

        @Deprecated
        @Removal(version="6.0.0")
        int getIndexAsInt()
        Deprecated.
        use getIndex() instead
        get the index within the XSSFWorkbook (sequence within the collection of Font objects)
        Returns:
        unique index number of the underlying record this Font represents (probably you don't care unless you're comparing which one is which)
        Since:
        4.0.0
      • setBold

        void setBold​(boolean bold)
      • getBold

        boolean getBold()