Class FontFormat


  • public class FontFormat
    extends System.Object
    This class stores the font options for shapes and other drawing objects. It allows to set the font name, font size, bold-italic options, foreground, underline, strikethrough, superscript, subscript, caps and character spacing.
    • Field Detail

      • UNDERLINE_NONE

        public const System.String UNDERLINE_NONE
        A constant indicating that no underline is set. Embedded value is "none".
        See Also:
        Constant Values
      • UNDERLINE_SINGLE_LINE

        public const System.String UNDERLINE_SINGLE_LINE
        A constant indicating the single line style for underline. Embedded value is "sng".
        See Also:
        Constant Values
      • UNDERLINE_DOUBLE_LINE

        public const System.String UNDERLINE_DOUBLE_LINE
        A constant indicating the double line style for underline. Embedded value is "dbl".
        See Also:
        Constant Values
      • UNDERLINE_HEAVY_LINE

        public const System.String UNDERLINE_HEAVY_LINE
        A constant indicating the heavy line style for underline. Embedded value is "heavy".
        See Also:
        Constant Values
      • UNDERLINE_DOTTED_LINE

        public const System.String UNDERLINE_DOTTED_LINE
        A constant indicating the dotted line style for underline. Embedded value is "dotted".
        See Also:
        Constant Values
      • UNDERLINE_DOTTED_HEAVY_LINE

        public const System.String UNDERLINE_DOTTED_HEAVY_LINE
        A constant indicating the dotted heavy line style for underline. Embedded value is "dottedHeavy".
        See Also:
        Constant Values
      • UNDERLINE_DASH_LINE

        public const System.String UNDERLINE_DASH_LINE
        A constant indicating the dash line style for underline. Embedded value is "dash".
        See Also:
        Constant Values
      • UNDERLINE_DASH_HEAVY_LINE

        public const System.String UNDERLINE_DASH_HEAVY_LINE
        A constant indicating the dash heavy line style for underline. Embedded value is "dashHeavy".
        See Also:
        Constant Values
      • UNDERLINE_DASH_LONG_LINE

        public const System.String UNDERLINE_DASH_LONG_LINE
        A constant indicating the dash long line style for underline. Embedded value is "dashLong".
        See Also:
        Constant Values
      • UNDERLINE_DASH_LONG_HEAVY_LINE

        public const System.String UNDERLINE_DASH_LONG_HEAVY_LINE
        A constant indicating the dash long heavy line style for underline. Embedded value is "dashLongHeavy".
        See Also:
        Constant Values
      • UNDERLINE_DOT_DASH_LINE

        public const System.String UNDERLINE_DOT_DASH_LINE
        A constant indicating the dot dash line style for underline. Embedded value is "dotDash".
        See Also:
        Constant Values
      • UNDERLINE_DOT_DASH_HEAVY_LINE

        public const System.String UNDERLINE_DOT_DASH_HEAVY_LINE
        A constant indicating the dot dash heavy line style for underline. Embedded value is "dotDashHeavy".
        See Also:
        Constant Values
      • UNDERLINE_DOT_DOT_DASH_LINE

        public const System.String UNDERLINE_DOT_DOT_DASH_LINE
        A constant indicating the dot dot dash line style for underline. Embedded value is "dotDotDash".
        See Also:
        Constant Values
      • UNDERLINE_DOT_DOT_DASH_HEAVY_LINE

        public const System.String UNDERLINE_DOT_DOT_DASH_HEAVY_LINE
        A constant indicating the dot dot dash heavy line style for underline. Embedded value is "dotDotDashHeavy".
        See Also:
        Constant Values
      • UNDERLINE_WAVY_LINE

        public const System.String UNDERLINE_WAVY_LINE
        A constant indicating the wavy line style for underline. Embedded value is "wavy".
        See Also:
        Constant Values
      • UNDERLINE_WAVY_HEAVY_LINE

        public const System.String UNDERLINE_WAVY_HEAVY_LINE
        A constant indicating the wavy heavy line style for underline. Embedded value is "wavyHeavy".
        See Also:
        Constant Values
      • UNDERLINE_WAVY_DOUBLE_LINE

        public const System.String UNDERLINE_WAVY_DOUBLE_LINE
        A constant indicating the wavy double line style for underline. Embedded value is "wavyDbl".
        See Also:
        Constant Values
      • SPACING_TYPE_NORMAL

        public const System.String SPACING_TYPE_NORMAL
        A constant indicating a normal character spacing. Embedded value is "normal".
        See Also:
        Constant Values
      • SPACING_TYPE_EXPANDED

        public const System.String SPACING_TYPE_EXPANDED
        A constant indicating an extended character spacing. Embedded value is "expanded".
        See Also:
        Constant Values
      • SPACING_TYPE_CONDENSED

        public const System.String SPACING_TYPE_CONDENSED
        A constant indicating a condensed character spacing. Embedded value is "condensed".
        See Also:
        Constant Values
    • Constructor Detail

      • FontFormat

        public FontFormat()
        Defines an instance of the font formatting.
    • Method Detail

      • getFont

        public System.String getFont()
        Returns the font name.
        Returns:
        the name of the font
        See Also:
        setFont(System.String)
      • setFont

        public void setFont​(System.String fontName)
        Sets the font name.
        Parameters:
        fontName - the name of the font
        See Also:
        getFont()
      • IsHeadingsFont

        public bool IsHeadingsFont()
        Returns true if the font is the headings font, false otherwise.
        Returns:
        true if the font is the headings font, false otherwise
        See Also:
        setHeadingsFont(), setFont(System.String)
      • IsBodyFont

        public bool IsBodyFont()
        Returns true if the font is the body font, false otherwise.
        Returns:
        true if the font is the body font, false otherwise
        See Also:
        setBodyFont(), setFont(System.String)
      • IsAutomaticFont

        public bool IsAutomaticFont()
        Returns true if the font is automatic, false otherwise.
        Returns:
        true if the font is automatic, false otherwise
        See Also:
        setFont(System.String)
      • IsBold

        public bool IsBold()
        Returns true if the font is bold, false otherwise.
        Returns:
        true if the font is bold, false otherwise
        See Also:
        setBold(bool)
      • setBold

        public void setBold​(bool isBold)
        Sets the bold setting of the font.
        Parameters:
        isBold - true if the font is bold, false otherwise
        See Also:
        IsBold()
      • IsItalic

        public bool IsItalic()
        Returns true if the font is italic, false otherwise.
        Returns:
        true if the font is italic, false otherwise
        See Also:
        setItalic(bool)
      • setItalic

        public void setItalic​(bool isItalic)
        Sets the italic setting of the font.
        Parameters:
        isItalic - true if the font is italic, false otherwise
        See Also:
        IsItalic()
      • IsAutomaticFontStyle

        public bool IsAutomaticFontStyle()
        Returns true if the font style is automatic, false otherwise.
        Returns:
        true if the font style is automatic, false otherwise
        See Also:
        setBold(bool), setItalic(bool)
      • getFontSize

        public float getFontSize()
        Returns the size of the font.
        Returns:
        the size of the font
        See Also:
        setFontSize(float)
      • setFontSize

        public void setFontSize​(float fontSize)
        Sets the size of the font.
        Parameters:
        fontSize - the size of the font
        See Also:
        getFontSize()
      • IsAutomaticFontSize

        public bool IsAutomaticFontSize()
        Returns true if the font size is automatic, false otherwise.
        Returns:
        true if the font size is automatic, false otherwise
        See Also:
        setFontSize(float)
      • setFontSettings

        public void setFontSettings​(System.String fontName,
                                    int fontSize,
                                    bool isBold,
                                    bool isItalic,
                                    System.Drawing.Color foreground)
        Sets the font settings.
        Parameters:
        fontName - the name of the font
        fontSize - the size of the font
        isBold - the bold option of the font
        isItalic - the italic option of the font
        foreground - the foreground color
      • setFontSettings

        public void setFontSettings​(System.String fontName,
                                    int fontSize,
                                    bool isBold,
                                    bool isItalic,
                                    ThemeColor foreground)
        Sets the font settings.
        Parameters:
        fontName - the name of the font
        fontSize - the size of the font
        isBold - the bold option of the font
        isItalic - the italic option of the font
        foreground - the foreground color
      • getForeground

        public System.Drawing.Color getForeground()
        Returns the font color.
        Returns:
        the font color
        See Also:
        setForeground(Color)
      • setForeground

        public void setForeground​(System.Drawing.Color foreground)
        Sets the font color.
        Parameters:
        foreground - the new color of font
        See Also:
        getForeground()
      • setForeground

        public void setForeground​(ThemeColor themeColor)
        Sets the font color.
        Parameters:
        themeColor - the foreground color of font
        See Also:
        getForegroundThemeColor()
      • setUnderlineSettings

        public void setUnderlineSettings​(System.String underlineStyle,
                                         bool isAutomaticColor)
        Sets the underline settings of the text.
        Parameters:
        underlineStyle - the underline style of the text. Possible values are available in FontFormat class.
        isAutomaticColor - true if underline color is automatic, false otherwise
        See Also:
        getUnderlineStyle(), IsAutomaticUnderlineColor()
      • setUnderlineSettings

        public void setUnderlineSettings​(System.String underlineStyle,
                                         System.Drawing.Color color)
        Sets the underline settings of the text.
        Parameters:
        underlineStyle - the underline style of the text. Possible values are available in FontFormat class.
        color - the color of the underline
        See Also:
        getUnderlineStyle(), getUnderlineColor()
      • setUnderlineSettings

        public void setUnderlineSettings​(System.String underlineStyle,
                                         ThemeColor color)
        Sets the underline settings of the text.
        Parameters:
        underlineStyle - the underline style of the text. Possible values are available in FontFormat class.
        color - the color of the underline
        See Also:
        getUnderlineStyle(), getUnderlineThemeColor()
      • setStrikethrough

        public void setStrikethrough​(bool isStrikethrough)
        Sets the strikethrough setting of the font.
        Parameters:
        isStrikethrough - the strikethrough setting of the font
        See Also:
        IsStrikethrough(), setDoubleStrikethrough(bool)
      • IsAutomaticStrikethrough

        public bool IsAutomaticStrikethrough()
        Returns true if the strikethrough is automatic, false otherwise.
        Returns:
        true if the strikethrough is automatic, false otherwise
        See Also:
        setStrikethrough(bool), setDoubleStrikethrough(bool)
      • IsDoubleStrikethrough

        public bool IsDoubleStrikethrough()
        Returns the double strikethrough setting of the font.
        Returns:
        the double strikethrough setting of the font
        See Also:
        setDoubleStrikethrough(bool), IsStrikethrough()
      • setDoubleStrikethrough

        public void setDoubleStrikethrough​(bool isDoubleStrikethrough)
        Sets the double strikethrough setting of the font.
        Parameters:
        isDoubleStrikethrough - the double strikethrough setting of the font
        See Also:
        IsDoubleStrikethrough(), setStrikethrough(bool)
      • getOffset

        public int getOffset()
        Returns the offset of the font for superscript and subscript options.
        Returns:
        the offset of the font for superscript and subscript options
        See Also:
        setSuperscript(bool,int), setSubscript(bool,int)
      • IsSmallCaps

        public bool IsSmallCaps()
        Returns the small caps setting of the font.
        Returns:
        the small caps setting of the font
        See Also:
        setSmallCaps(bool)
      • setSmallCaps

        public void setSmallCaps​(bool isSmallCaps)
        Sets the small caps setting of the font.
        Parameters:
        isSmallCaps - the new value of the small caps setting
        See Also:
        IsSmallCaps()
      • IsAllCaps

        public bool IsAllCaps()
        Returns the all caps setting of the font.
        Returns:
        the all caps setting of the font
        See Also:
        setAllCaps(bool)
      • setAllCaps

        public void setAllCaps​(bool isAllCaps)
        Sets the all caps setting of the font.
        Parameters:
        isAllCaps - the new value of the all caps setting
        See Also:
        IsAllCaps()
      • IsAutomaticCaps

        public bool IsAutomaticCaps()
        Returns true if the caps are automatic, false otherwise.
        Returns:
        true if the caps are automatic, false otherwise
        See Also:
        setSmallCaps(bool), setAllCaps(bool)
      • IsEqualizeCharacterHeight

        public bool IsEqualizeCharacterHeight()
        Returns the equalize character height setting of the font.
        Returns:
        the equalize character height setting of the font
        See Also:
        setEqualizeCharacterHeight(bool)
      • setEqualizeCharacterHeight

        public void setEqualizeCharacterHeight​(bool isEqualizeCharacterHeight)
        Sets the equalize character height setting of the font.
        Parameters:
        isEqualizeCharacterHeight - the equalize character height setting of the font
        See Also:
        IsEqualizeCharacterHeight()
      • IsAutomaticEqualizeCharacterHeight

        public bool IsAutomaticEqualizeCharacterHeight()
        Returns true if the character height is automatic, false otherwise.
        Returns:
        true if the character height is automatic, false otherwise
        See Also:
        setEqualizeCharacterHeight(bool)
      • setCharacterSpacing

        public void setCharacterSpacing​(System.String type,
                                        float spacingBy)
        Sets the character spacing of the font.
        Parameters:
        type - character spacing of the font. Possible values are available in FontFormat class
        spacingBy - the space between chars in points. For FontFormat.SPACING_TYPE_NORMAL the value is ignored.
        See Also:
        getSpacingType(), getSpacingBy(), setKerningForFonts(float)
      • IsAutomaticCharacterSpacing

        public bool IsAutomaticCharacterSpacing()
        Returns true if the character spacing is automatic, false otherwise.
        Returns:
        true if the character spacing is automatic, false otherwise
        See Also:
        setCharacterSpacing(System.String, float)
      • IsAutomaticKerningForFonts

        public bool IsAutomaticKerningForFonts()
        Returns true if the kerning for fonts is automatic, false otherwise.
        Returns:
        true if the kerning for fonts is automatic, false otherwise
        See Also:
        setKerningForFonts(float)
      • Clone

        public FontFormat Clone()
        Creates and returns a copy of this object.
        Returns:
        a clone of this instance.