Class HSSFFont

    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected HSSFFont​(short index, FontRecord rec)
      Creates a new instance of HSSFFont
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      short getBoldweight()
      get the boldness to use
      byte getCharSet()
      get character-set to use.
      short getColor()
      get the color for the font
      short getFontHeight()
      get the font height in unit's of 1/20th of a point.
      short getFontHeightInPoints()
      get the font height
      java.lang.String getFontName()
      get the name for the font (i.e.
      short getIndex()
      get the index within the HSSFWorkbook (sequence within the collection of Font objects)
      boolean getItalic()
      get whether to use italics or not
      boolean getStrikeout()
      get whether to use a strikeout horizontal line through the text or not
      short getTypeOffset()
      get normal,super or subscript.
      byte getUnderline()
      get type of text underlining to use
      void setBoldweight​(short boldweight)
      set the boldness to use
      void setCharSet​(byte charset)
      set character-set to use.
      void setColor​(short color)
      set the color for the font
      void setFontHeight​(short height)
      set the font height in unit's of 1/20th of a point.
      void setFontHeightInPoints​(short height)
      set the font height
      void setFontName​(java.lang.String name)
      set the name for the font (i.e.
      void setItalic​(boolean italic)
      set whether to use italics or not
      void setStrikeout​(boolean strikeout)
      set whether to use a strikeout horizontal line through the text or not
      void setTypeOffset​(short offset)
      set normal,super or subscript.
      void setUnderline​(byte underline)
      set type of text underlining to use
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • HSSFFont

        protected HSSFFont​(short index,
                           FontRecord rec)
        Creates a new instance of HSSFFont
    • Method Detail

      • setFontName

        public 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
        See Also:
        FONT_ARIAL
      • getFontName

        public java.lang.String getFontName()
        get the name for the font (i.e. Arial)
        Returns:
        String representing the name of the font to use
        See Also:
        FONT_ARIAL
      • getIndex

        public short getIndex()
        get the index within the HSSFWorkbook (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)
      • setFontHeight

        public 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

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

        public short getFontHeight()
        get the font height in unit's of 1/20th of a point. Maybe you might want to use the getFontHeightInPoints which matches to the familiar 10, 12, 14 etc..
        Returns:
        short - height in 1/20ths of a point
        See Also:
        getFontHeightInPoints()
      • getFontHeightInPoints

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

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

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

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

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

        public short getColor()
        get the color for the font
        Returns:
        color to use
        See Also:
        COLOR_NORMAL, COLOR_RED
      • setTypeOffset

        public 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

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

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object