Class FontRecord


  • public final class FontRecord
    extends StandardRecord
    Title: Font Record (0x0031)

    - describes a font in the workbook (index = 0-3,5-infinity - skip 4)

    Description: An element in the Font Table

    REFERENCE: PG 315 Microsoft Excel 97 Developer's Kit (ISBN: 1-57231-498-2)

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void cloneStyleFrom​(FontRecord source)
      Clones all the font style information from another FontRecord, onto this one.
      boolean equals​(java.lang.Object o)  
      short getAttributes()
      get the font attributes (see individual bit getters that reference this method)
      short getBoldWeight()
      get the bold weight for this font (100-1000dec or 0x64-0x3e8).
      byte getCharset()
      get the character set
      short getColorPaletteIndex()
      get the font's color palette index
      byte getFamily()
      get the font family (TODO)
      short getFontHeight()
      gets the height of the font in 1/20th point units
      java.lang.String getFontName()
      get the name of the font
      short getSid()
      return the non static version of the id for this record.
      short getSuperSubScript()
      get the type of super or subscript for the font
      byte getUnderline()
      get the type of underlining for the font
      int hashCode()  
      boolean isItalic()
      get whether the font is to be italics or not
      boolean isMacoutlined()
      whether to use the mac outline font style thing (mac only) - Some mac person should comment this instead of me doing it (since I have no idea)
      boolean isMacshadowed()
      whether to use the mac shado font style thing (mac only) - Some mac person should comment this instead of me doing it (since I have no idea)
      boolean isStruckout()
      get whether the font is to be stricken out or not
      boolean sameProperties​(FontRecord other)
      Does this FontRecord have all the same font properties as the supplied FontRecord? Note that equals(Object) will check for exact objects, while this will check for exact contents, because normally the font record's position makes a big difference too.
      void serialize​(LittleEndianOutput out)  
      void setAttributes​(short attributes)
      set the font attributes (see individual bit setters that reference this method)
      void setBoldWeight​(short bw)
      set the bold weight for this font (100-1000dec or 0x64-0x3e8).
      void setCharset​(byte charset)
      set the character set
      void setColorPaletteIndex​(short cpi)
      set the font's color palette index
      void setFamily​(byte f)
      set the font family (TODO)
      void setFontHeight​(short height)
      sets the height of the font in 1/20th point units
      void setFontName​(java.lang.String fn)
      set the name of the font
      void setItalic​(boolean italics)
      set the font to be italics or not
      void setMacoutline​(boolean mac)
      whether to use the mac outline font style thing (mac only) - Some mac person should comment this instead of me doing it (since I have no idea)
      void setMacshadow​(boolean mac)
      whether to use the mac shado font style thing (mac only) - Some mac person should comment this instead of me doing it (since I have no idea)
      void setStrikeout​(boolean strike)
      set the font to be stricken out or not
      void setSuperSubScript​(short sss)
      set the type of super or subscript for the font
      void setUnderline​(byte u)
      set the type of underlining for the font
      java.lang.String toString()
      get a string representation of the record (for biffview/debugging)
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • FontRecord

        public FontRecord()
    • Method Detail

      • setFontHeight

        public void setFontHeight​(short height)
        sets the height of the font in 1/20th point units
        Parameters:
        height - fontheight (in points/20)
      • setAttributes

        public void setAttributes​(short attributes)
        set the font attributes (see individual bit setters that reference this method)
        Parameters:
        attributes - the bitmask to set
      • setItalic

        public void setItalic​(boolean italics)
        set the font to be italics or not
        Parameters:
        italics - - whether the font is italics or not
        See Also:
        setAttributes(short)
      • setStrikeout

        public void setStrikeout​(boolean strike)
        set the font to be stricken out or not
        Parameters:
        strike - - whether the font is stricken out or not
        See Also:
        setAttributes(short)
      • setMacoutline

        public void setMacoutline​(boolean mac)
        whether to use the mac outline font style thing (mac only) - Some mac person should comment this instead of me doing it (since I have no idea)
        Parameters:
        mac - - whether to do that mac font outline thing or not
        See Also:
        setAttributes(short)
      • setMacshadow

        public void setMacshadow​(boolean mac)
        whether to use the mac shado font style thing (mac only) - Some mac person should comment this instead of me doing it (since I have no idea)
        Parameters:
        mac - - whether to do that mac font shadow thing or not
        See Also:
        setAttributes(short)
      • setColorPaletteIndex

        public void setColorPaletteIndex​(short cpi)
        set the font's color palette index
        Parameters:
        cpi - - font color index
      • setBoldWeight

        public void setBoldWeight​(short bw)
        set the bold weight for this font (100-1000dec or 0x64-0x3e8). Default is 0x190 for normal and 0x2bc for bold
        Parameters:
        bw - - a number between 100-1000 for the fonts "boldness"
      • setSuperSubScript

        public void setSuperSubScript​(short sss)
        set the type of super or subscript for the font
        Parameters:
        sss - super or subscript option
        See Also:
        SS_NONE, SS_SUPER, SS_SUB
      • setFamily

        public void setFamily​(byte f)
        set the font family (TODO)
        Parameters:
        f - family
      • setCharset

        public void setCharset​(byte charset)
        set the character set
        Parameters:
        charset - - character set
      • setFontName

        public void setFontName​(java.lang.String fn)
        set the name of the font
        Parameters:
        fn - - name of the font (i.e. "Arial")
      • getFontHeight

        public short getFontHeight()
        gets the height of the font in 1/20th point units
        Returns:
        fontheight (in points/20)
      • getAttributes

        public short getAttributes()
        get the font attributes (see individual bit getters that reference this method)
        Returns:
        attribute - the bitmask
      • isItalic

        public boolean isItalic()
        get whether the font is to be italics or not
        Returns:
        italics - whether the font is italics or not
        See Also:
        getAttributes()
      • isStruckout

        public boolean isStruckout()
        get whether the font is to be stricken out or not
        Returns:
        strike - whether the font is stricken out or not
        See Also:
        getAttributes()
      • isMacoutlined

        public boolean isMacoutlined()
        whether to use the mac outline font style thing (mac only) - Some mac person should comment this instead of me doing it (since I have no idea)
        Returns:
        mac - whether to do that mac font outline thing or not
        See Also:
        getAttributes()
      • isMacshadowed

        public boolean isMacshadowed()
        whether to use the mac shado font style thing (mac only) - Some mac person should comment this instead of me doing it (since I have no idea)
        Returns:
        mac - whether to do that mac font shadow thing or not
        See Also:
        getAttributes()
      • getColorPaletteIndex

        public short getColorPaletteIndex()
        get the font's color palette index
        Returns:
        cpi - font color index
      • getBoldWeight

        public short getBoldWeight()
        get the bold weight for this font (100-1000dec or 0x64-0x3e8). Default is 0x190 for normal and 0x2bc for bold
        Returns:
        bw - a number between 100-1000 for the fonts "boldness"
      • getSuperSubScript

        public short getSuperSubScript()
        get the type of super or subscript for the font
        Returns:
        super or subscript option
        See Also:
        SS_NONE, SS_SUPER, SS_SUB
      • getFamily

        public byte getFamily()
        get the font family (TODO)
        Returns:
        family
      • getCharset

        public byte getCharset()
        get the character set
        Returns:
        charset - character set
      • getFontName

        public java.lang.String getFontName()
        get the name of the font
        Returns:
        fn - name of the font (i.e. "Arial")
      • toString

        public java.lang.String toString()
        Description copied from class: Record
        get a string representation of the record (for biffview/debugging)
        Overrides:
        toString in class Record
      • getSid

        public short getSid()
        Description copied from class: Record
        return the non static version of the id for this record.
        Specified by:
        getSid in class Record
        Returns:
        he id for this record
      • cloneStyleFrom

        public void cloneStyleFrom​(FontRecord source)
        Clones all the font style information from another FontRecord, onto this one. This will then hold all the same font style options.
        Parameters:
        source - the record to clone the properties from
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • sameProperties

        public boolean sameProperties​(FontRecord other)
        Does this FontRecord have all the same font properties as the supplied FontRecord? Note that equals(Object) will check for exact objects, while this will check for exact contents, because normally the font record's position makes a big difference too.
        Parameters:
        other - the record to compare with
        Returns:
        true, if the properties match
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object