Font

Inheritance: java.lang.Object

public class Font

Contains font attributes (font name, font size, color, and so on) for an object.

To learn more, visit the Working with Fonts documentation article.

You do not create instances of the Font class directly. You just use Font to access the font properties of the various objects such as Run, Paragraph, Style, DocumentBuilder.

Methods

Method Description
clearFormatting() Resets to default font formatting.
equals(Object arg0)
fetchInheritedBorderAttr(int key)
fetchInheritedShadingAttr(int key)
getAllCaps() True if the font is formatted as all capital letters.
getAutoColor() Returns the present calculated color of the text (black or white) to be used for ‘auto color’.
getBidi() Specifies whether the contents of this run shall have right-to-left characteristics.
getBold() True if the font is formatted as bold.
getBoldBi() True if the right-to-left text is formatted as bold.
getBorder() Returns a Border object that specifies border for the font.
getClass()
getColor() Gets the color of the font.
getComplexScript() Specifies whether the contents of this run shall be treated as complex script text regardless of their Unicode character values when determining the formatting for this run.
getDirectBorderAttr(int key)
getDoubleStrikeThrough() True if the font is formatted as double strikethrough text.
getEmboss() True if the font is formatted as embossed.
getEmphasisMark() Gets the emphasis mark applied to this formatting.
getEngrave() True if the font is formatted as engraved.
getFill() Gets fill formatting for the Font.
getFillType()
getFillableBackColor()
getFillableForeColor()
getFillableImageBytes()
getFillableTransparency()
getFillableVisible()
getFilledColor()
getGradientAngle()
getGradientStops()
getGradientStyle()
getGradientVariant()
getHidden() True if the font is formatted as hidden text.
getHighlightColor() Gets the highlight (marker) color.
getItalic() True if the font is formatted as italic.
getItalicBi() True if the right-to-left text is formatted as italic.
getKerning() Gets the font size at which kerning starts.
getLineSpacing() Returns line spacing of this font (in points).
getLocaleId() Gets the locale identifier (language) of the formatted characters.
getLocaleIdBi() Gets the locale identifier (language) of the formatted right-to-left characters.
getLocaleIdFarEast() Gets the locale identifier (language) of the formatted Asian characters.
getName() Gets the name of the font.
getNameAscii() Gets the font used for Latin text (characters with character codes from 0 (zero) through 127).
getNameBi() Gets the name of the font in a right-to-left language document.
getNameFarEast() Gets an East Asian font name.
getNameOther() Gets the font used for characters with character codes from 128 through 255.
getNoProofing() True when the formatted characters are not to be spell checked.
getOn()
getOpacity()
getOutline() True if the font is formatted as outline.
getPatternType()
getPosition() Gets the position of text (in points) relative to the base line.
getPresetTexture()
getRotateWithObject()
getScaling() Gets character width scaling in percent.
getShading() Returns a Shading object that refers to the shading formatting for the font.
getShadow() True if the font is formatted as shadowed.
getSize() Gets the font size in points.
getSizeBi() Gets the font size in points used in a right-to-left document.
getSmallCaps() True if the font is formatted as small capital letters.
getSnapToGrid() Specifies whether the current font should use the document grid characters per line settings when laying out.
getSpacing() Gets the spacing (in points) between characters .
getStrikeThrough() True if the font is formatted as strikethrough text.
getStyle() Gets the character style applied to this formatting.
getStyleIdentifier() Gets the locale independent style identifier of the character style applied to this formatting.
getStyleName() Gets the name of the character style applied to this formatting.
getSubscript() True if the font is formatted as subscript.
getSuperscript() True if the font is formatted as superscript.
getTextEffect() Gets the font animation effect.
getTextureAlignment()
getThemeColor() Gets the theme color in the applied color scheme that is associated with this Font object.
getThemeFont() Gets the theme font in the applied font scheme that is associated with this Font object.
getThemeFontAscii() Gets the theme font used for Latin text (characters with character codes from 0 (zero) through 127) in the applied font scheme that is associated with this Font object.
getThemeFontBi() Gets the theme font in the applied font scheme that is associated with this Font object in a right-to-left language document.
getThemeFontFarEast() Gets the East Asian theme font in the applied font scheme that is associated with this Font object.
getThemeFontOther() Gets the theme font used for characters with character codes from 128 through 255 in the applied font scheme that is associated with this Font object.
getTintAndShade() Gets a double value that lightens or darkens a color.
getUnderline() Gets the type of underline applied to the font.
getUnderlineColor() Gets the color of the underline applied to the font.
hasDmlEffect(int dmlEffectType)
hashCode()
notify()
notifyAll()
oneColorGradient(int style, int variant, double degree)
patterned(int patternType)
presetTextured(int presetTexture)
setAllCaps(boolean value) True if the font is formatted as all capital letters.
setBidi(boolean value) Specifies whether the contents of this run shall have right-to-left characteristics.
setBold(boolean value) True if the font is formatted as bold.
setBoldBi(boolean value) True if the right-to-left text is formatted as bold.
setBorderAttr(int key, Object value)
setColor(Color value) Sets the color of the font.
setComplexScript(boolean value) Specifies whether the contents of this run shall be treated as complex script text regardless of their Unicode character values when determining the formatting for this run.
setDoubleStrikeThrough(boolean value) True if the font is formatted as double strikethrough text.
setEmboss(boolean value) True if the font is formatted as embossed.
setEmphasisMark(int value) Sets the emphasis mark applied to this formatting.
setEngrave(boolean value) True if the font is formatted as engraved.
setFillableBackColor(Color value)
setFillableForeColor(Color value)
setFillableTransparency(double value)
setFillableVisible(boolean value)
setFilledColor(Color value)
setGradientAngle(double value)
setHidden(boolean value) True if the font is formatted as hidden text.
setHighlightColor(Color value) Sets the highlight (marker) color.
setImage(byte[] imageBytes)
setItalic(boolean value) True if the font is formatted as italic.
setItalicBi(boolean value) True if the right-to-left text is formatted as italic.
setKerning(double value) Sets the font size at which kerning starts.
setLocaleId(int value) Sets the locale identifier (language) of the formatted characters.
setLocaleIdBi(int value) Sets the locale identifier (language) of the formatted right-to-left characters.
setLocaleIdFarEast(int value) Sets the locale identifier (language) of the formatted Asian characters.
setName(String value) Sets the name of the font.
setNameAscii(String value) Sets the font used for Latin text (characters with character codes from 0 (zero) through 127).
setNameBi(String value) Sets the name of the font in a right-to-left language document.
setNameFarEast(String value) Sets an East Asian font name.
setNameOther(String value) Sets the font used for characters with character codes from 128 through 255.
setNoProofing(boolean value) True when the formatted characters are not to be spell checked.
setOn(boolean value)
setOpacity(double value)
setOutline(boolean value) True if the font is formatted as outline.
setPosition(double value) Sets the position of text (in points) relative to the base line.
setRotateWithObject(boolean value)
setScaling(int value) Sets character width scaling in percent.
setShadow(boolean value) True if the font is formatted as shadowed.
setSize(double value) Sets the font size in points.
setSizeBi(double value) Sets the font size in points used in a right-to-left document.
setSmallCaps(boolean value) True if the font is formatted as small capital letters.
setSnapToGrid(boolean value) Specifies whether the current font should use the document grid characters per line settings when laying out.
setSpacing(double value) Sets the spacing (in points) between characters .
setStrikeThrough(boolean value) True if the font is formatted as strikethrough text.
setStyle(Style value) Sets the character style applied to this formatting.
setStyleIdentifier(int value) Sets the locale independent style identifier of the character style applied to this formatting.
setStyleName(String value) Sets the name of the character style applied to this formatting.
setSubscript(boolean value) True if the font is formatted as subscript.
setSuperscript(boolean value) True if the font is formatted as superscript.
setTextEffect(int value) Sets the font animation effect.
setTextureAlignment(int value)
setThemeColor(int value) Sets the theme color in the applied color scheme that is associated with this Font object.
setThemeFont(int value) Sets the theme font in the applied font scheme that is associated with this Font object.
setThemeFontAscii(int value) Sets the theme font used for Latin text (characters with character codes from 0 (zero) through 127) in the applied font scheme that is associated with this Font object.
setThemeFontBi(int value) Sets the theme font in the applied font scheme that is associated with this Font object in a right-to-left language document.
setThemeFontFarEast(int value) Sets the East Asian theme font in the applied font scheme that is associated with this Font object.
setThemeFontOther(int value) Sets the theme font used for characters with character codes from 128 through 255 in the applied font scheme that is associated with this Font object.
setTintAndShade(double value) Sets a double value that lightens or darkens a color.
setUnderline(int value) Sets the type of underline applied to the font.
setUnderlineColor(Color value) Sets the color of the underline applied to the font.
solid()
toString()
twoColorGradient(int style, int variant)
wait()
wait(long arg0)
wait(long arg0, int arg1)

clearFormatting()

public void clearFormatting()

Resets to default font formatting.

Removes all font formatting specified explicitly on the object from which Font was obtained so the font formatting will be inherited from the appropriate parent.

equals(Object arg0)

public boolean equals(Object arg0)

Parameters:

Parameter Type Description
arg0 java.lang.Object

Returns: boolean

fetchInheritedBorderAttr(int key)

public Object fetchInheritedBorderAttr(int key)

Parameters:

Parameter Type Description
key int

Returns: java.lang.Object

fetchInheritedShadingAttr(int key)

public Object fetchInheritedShadingAttr(int key)

Parameters:

Parameter Type Description
key int

Returns: java.lang.Object

getAllCaps()

public boolean getAllCaps()

True if the font is formatted as all capital letters.

Returns: boolean - The corresponding boolean value.

getAutoColor()

public Color getAutoColor()

Returns the present calculated color of the text (black or white) to be used for ‘auto color’. If the color is not ‘auto’ then returns getColor() / setColor(java.awt.Color).

When text has ‘automatic color’, the actual color of text is calculated automatically so that it is readable against the background color. As you change the background color, the text color will automatically switch to black or white in MS Word to maximize legibility.

Returns: java.awt.Color - The present calculated color of the text (black or white) to be used for ‘auto color’.

getBidi()

public boolean getBidi()

Specifies whether the contents of this run shall have right-to-left characteristics.

This property, when on, shall not be used with strongly left-to-right text. Any behavior under that condition is unspecified. This property, when off, shall not be used with strong right-to-left text. Any behavior under that condition is unspecified.

When the contents of this run are displayed, all characters shall be treated as complex script characters for formatting purposes. This means that getBoldBi() / setBoldBi(boolean), getItalicBi() / setItalicBi(boolean), getSizeBi() / setSizeBi(double) and a corresponding font name will be used when rendering this run.

Also, when the contents of this run are displayed, this property acts as a right-to-left override for characters which are classified as “weak types” and “neutral types”.

Returns: boolean - The corresponding boolean value.

getBold()

public boolean getBold()

True if the font is formatted as bold.

Returns: boolean - The corresponding boolean value.

getBoldBi()

public boolean getBoldBi()

True if the right-to-left text is formatted as bold.

Returns: boolean - The corresponding boolean value.

getBorder()

public Border getBorder()

Returns a Border object that specifies border for the font.

Returns: Border - A Border object that specifies border for the font.

getClass()

public final native Class<?> getClass()

Returns: java.lang.Class

getColor()

public Color getColor()

Gets the color of the font.

Returns: java.awt.Color - The color of the font.

getComplexScript()

public boolean getComplexScript()

Specifies whether the contents of this run shall be treated as complex script text regardless of their Unicode character values when determining the formatting for this run.

Returns: boolean - The corresponding boolean value.

getDirectBorderAttr(int key)

public Object getDirectBorderAttr(int key)

Parameters:

Parameter Type Description
key int

Returns: java.lang.Object

getDoubleStrikeThrough()

public boolean getDoubleStrikeThrough()

True if the font is formatted as double strikethrough text.

Returns: boolean - The corresponding boolean value.

getEmboss()

public boolean getEmboss()

True if the font is formatted as embossed.

Returns: boolean - The corresponding boolean value.

getEmphasisMark()

public int getEmphasisMark()

Gets the emphasis mark applied to this formatting.

Returns: int - The emphasis mark applied to this formatting. The returned value is one of EmphasisMark constants.

getEngrave()

public boolean getEngrave()

True if the font is formatted as engraved.

Returns: boolean - The corresponding boolean value.

getFill()

public Fill getFill()

Gets fill formatting for the Font.

Returns: Fill - Fill formatting for the Font.

getFillType()

public int getFillType()

Returns: int

getFillableBackColor()

public Color getFillableBackColor()

Returns: java.awt.Color

getFillableForeColor()

public Color getFillableForeColor()

Returns: java.awt.Color

getFillableImageBytes()

public byte[] getFillableImageBytes()

Returns: byte[]

getFillableTransparency()

public double getFillableTransparency()

Returns: double

getFillableVisible()

public boolean getFillableVisible()

Returns: boolean

getFilledColor()

public Color getFilledColor()

Returns: java.awt.Color

getGradientAngle()

public double getGradientAngle()

Returns: double

getGradientStops()

public GradientStopCollection getGradientStops()

Returns: GradientStopCollection

getGradientStyle()

public int getGradientStyle()

Returns: int

getGradientVariant()

public int getGradientVariant()

Returns: int

getHidden()

public boolean getHidden()

True if the font is formatted as hidden text.

Returns: boolean - The corresponding boolean value.

getHighlightColor()

public Color getHighlightColor()

Gets the highlight (marker) color.

Returns: java.awt.Color - The highlight (marker) color.

getItalic()

public boolean getItalic()

True if the font is formatted as italic.

Returns: boolean - The corresponding boolean value.

getItalicBi()

public boolean getItalicBi()

True if the right-to-left text is formatted as italic.

Returns: boolean - The corresponding boolean value.

getKerning()

public double getKerning()

Gets the font size at which kerning starts.

Returns: double - The font size at which kerning starts.

getLineSpacing()

public double getLineSpacing()

Returns line spacing of this font (in points).

Returns: double - Line spacing of this font (in points).

getLocaleId()

public int getLocaleId()

Gets the locale identifier (language) of the formatted characters. For the list of locale identifiers see https://msdn.microsoft.com/en-us/library/cc233965.aspx

Returns: int - The locale identifier (language) of the formatted characters.

getLocaleIdBi()

public int getLocaleIdBi()

Gets the locale identifier (language) of the formatted right-to-left characters. For the list of locale identifiers see https://msdn.microsoft.com/en-us/library/cc233965.aspx

Returns: int - The locale identifier (language) of the formatted right-to-left characters.

getLocaleIdFarEast()

public int getLocaleIdFarEast()

Gets the locale identifier (language) of the formatted Asian characters. For the list of locale identifiers see https://msdn.microsoft.com/en-us/library/cc233965.aspx

Returns: int - The locale identifier (language) of the formatted Asian characters.

getName()

public String getName()

Gets the name of the font.

When getting, returns getNameAscii() / setNameAscii(java.lang.String).

When setting, sets getNameAscii() / setNameAscii(java.lang.String), getNameBi() / setNameBi(java.lang.String), getNameFarEast() / setNameFarEast(java.lang.String) and getNameOther() / setNameOther(java.lang.String) to the specified value.

Returns: java.lang.String - The name of the font.

getNameAscii()

public String getNameAscii()

Gets the font used for Latin text (characters with character codes from 0 (zero) through 127).

Returns: java.lang.String - The font used for Latin text (characters with character codes from 0 (zero) through 127).

getNameBi()

public String getNameBi()

Gets the name of the font in a right-to-left language document.

Returns: java.lang.String - The name of the font in a right-to-left language document.

getNameFarEast()

public String getNameFarEast()

Gets an East Asian font name.

Returns: java.lang.String - An East Asian font name.

getNameOther()

public String getNameOther()

Gets the font used for characters with character codes from 128 through 255.

Returns: java.lang.String - The font used for characters with character codes from 128 through 255.

getNoProofing()

public boolean getNoProofing()

True when the formatted characters are not to be spell checked.

Returns: boolean - The corresponding boolean value.

getOn()

public boolean getOn()

Returns: boolean

getOpacity()

public double getOpacity()

Returns: double

getOutline()

public boolean getOutline()

True if the font is formatted as outline.

Returns: boolean - The corresponding boolean value.

getPatternType()

public int getPatternType()

Returns: int

getPosition()

public double getPosition()

Gets the position of text (in points) relative to the base line. A positive number raises the text, and a negative number lowers it.

Returns: double - The position of text (in points) relative to the base line.

getPresetTexture()

public int getPresetTexture()

Returns: int

getRotateWithObject()

public boolean getRotateWithObject()

Returns: boolean

getScaling()

public int getScaling()

Gets character width scaling in percent.

Returns: int - Character width scaling in percent.

getShading()

public Shading getShading()

Returns a Shading object that refers to the shading formatting for the font.

Returns: Shading - A Shading object that refers to the shading formatting for the font.

getShadow()

public boolean getShadow()

True if the font is formatted as shadowed.

Returns: boolean - The corresponding boolean value.

getSize()

public double getSize()

Gets the font size in points.

Returns: double - The font size in points.

getSizeBi()

public double getSizeBi()

Gets the font size in points used in a right-to-left document.

Returns: double - The font size in points used in a right-to-left document.

getSmallCaps()

public boolean getSmallCaps()

True if the font is formatted as small capital letters.

Returns: boolean - The corresponding boolean value.

getSnapToGrid()

public boolean getSnapToGrid()

Specifies whether the current font should use the document grid characters per line settings when laying out.

Returns: boolean - The corresponding boolean value.

getSpacing()

public double getSpacing()

Gets the spacing (in points) between characters .

Returns: double - The spacing (in points) between characters .

getStrikeThrough()

public boolean getStrikeThrough()

True if the font is formatted as strikethrough text.

Returns: boolean - The corresponding boolean value.

getStyle()

public Style getStyle()

Gets the character style applied to this formatting.

Returns: Style - The character style applied to this formatting.

getStyleIdentifier()

public int getStyleIdentifier()

Gets the locale independent style identifier of the character style applied to this formatting.

Returns: int - The locale independent style identifier of the character style applied to this formatting. The returned value is one of StyleIdentifier constants.

getStyleName()

public String getStyleName()

Gets the name of the character style applied to this formatting.

Returns: java.lang.String - The name of the character style applied to this formatting.

getSubscript()

public boolean getSubscript()

True if the font is formatted as subscript.

Returns: boolean - The corresponding boolean value.

getSuperscript()

public boolean getSuperscript()

True if the font is formatted as superscript.

Returns: boolean - The corresponding boolean value.

getTextEffect()

public int getTextEffect()

Gets the font animation effect.

Returns: int - The font animation effect. The returned value is one of TextEffect constants.

getTextureAlignment()

public int getTextureAlignment()

Returns: int

getThemeColor()

public int getThemeColor()

Gets the theme color in the applied color scheme that is associated with this Font object.

Returns: int - The theme color in the applied color scheme that is associated with this Font object. The returned value is one of ThemeColor constants.

getThemeFont()

public int getThemeFont()

Gets the theme font in the applied font scheme that is associated with this Font object.

Returns: int - The theme font in the applied font scheme that is associated with this Font object. The returned value is one of ThemeFont constants.

getThemeFontAscii()

public int getThemeFontAscii()

Gets the theme font used for Latin text (characters with character codes from 0 (zero) through 127) in the applied font scheme that is associated with this Font object.

Returns: int - The theme font used for Latin text (characters with character codes from 0 (zero) through 127) in the applied font scheme that is associated with this Font object. The returned value is one of ThemeFont constants.

getThemeFontBi()

public int getThemeFontBi()

Gets the theme font in the applied font scheme that is associated with this Font object in a right-to-left language document.

Returns: int - The theme font in the applied font scheme that is associated with this Font object in a right-to-left language document. The returned value is one of ThemeFont constants.

getThemeFontFarEast()

public int getThemeFontFarEast()

Gets the East Asian theme font in the applied font scheme that is associated with this Font object.

Returns: int - The East Asian theme font in the applied font scheme that is associated with this Font object. The returned value is one of ThemeFont constants.

getThemeFontOther()

public int getThemeFontOther()

Gets the theme font used for characters with character codes from 128 through 255 in the applied font scheme that is associated with this Font object.

Returns: int - The theme font used for characters with character codes from 128 through 255 in the applied font scheme that is associated with this Font object. The returned value is one of ThemeFont constants.

getTintAndShade()

public double getTintAndShade()

Gets a double value that lightens or darkens a color.

The allowed values are in range from -1 (darkest) to 1 (lightest) for this property. Zero (0) is neutral. Attempting to set this property to a value less than -1 or more than 1 results in a java.lang.IllegalArgumentException.

Setting this property for Font object with non-theme colors results in a java.lang.IllegalStateException.

Returns: double - A double value that lightens or darkens a color.

getUnderline()

public int getUnderline()

Gets the type of underline applied to the font.

Returns: int - The type of underline applied to the font. The returned value is one of Underline constants.

getUnderlineColor()

public Color getUnderlineColor()

Gets the color of the underline applied to the font.

Returns: java.awt.Color - The color of the underline applied to the font.

hasDmlEffect(int dmlEffectType)

public boolean hasDmlEffect(int dmlEffectType)

Parameters:

Parameter Type Description
dmlEffectType int

Returns: boolean

hashCode()

public native int hashCode()

Returns: int

notify()

public final native void notify()

notifyAll()

public final native void notifyAll()

oneColorGradient(int style, int variant, double degree)

public void oneColorGradient(int style, int variant, double degree)

Parameters:

Parameter Type Description
style int
variant int
degree double

patterned(int patternType)

public void patterned(int patternType)

Parameters:

Parameter Type Description
patternType int

presetTextured(int presetTexture)

public void presetTextured(int presetTexture)

Parameters:

Parameter Type Description
presetTexture int

setAllCaps(boolean value)

public void setAllCaps(boolean value)

True if the font is formatted as all capital letters.

Parameters:

Parameter Type Description
value boolean The corresponding boolean value.

setBidi(boolean value)

public void setBidi(boolean value)

Specifies whether the contents of this run shall have right-to-left characteristics.

This property, when on, shall not be used with strongly left-to-right text. Any behavior under that condition is unspecified. This property, when off, shall not be used with strong right-to-left text. Any behavior under that condition is unspecified.

When the contents of this run are displayed, all characters shall be treated as complex script characters for formatting purposes. This means that getBoldBi() / setBoldBi(boolean), getItalicBi() / setItalicBi(boolean), getSizeBi() / setSizeBi(double) and a corresponding font name will be used when rendering this run.

Also, when the contents of this run are displayed, this property acts as a right-to-left override for characters which are classified as “weak types” and “neutral types”.

Parameters:

Parameter Type Description
value boolean The corresponding boolean value.

setBold(boolean value)

public void setBold(boolean value)

True if the font is formatted as bold.

Parameters:

Parameter Type Description
value boolean The corresponding boolean value.

setBoldBi(boolean value)

public void setBoldBi(boolean value)

True if the right-to-left text is formatted as bold.

Parameters:

Parameter Type Description
value boolean The corresponding boolean value.

setBorderAttr(int key, Object value)

public void setBorderAttr(int key, Object value)

Parameters:

Parameter Type Description
key int
value java.lang.Object

setColor(Color value)

public void setColor(Color value)

Sets the color of the font.

Parameters:

Parameter Type Description
value java.awt.Color The color of the font.

setComplexScript(boolean value)

public void setComplexScript(boolean value)

Specifies whether the contents of this run shall be treated as complex script text regardless of their Unicode character values when determining the formatting for this run.

Parameters:

Parameter Type Description
value boolean The corresponding boolean value.

setDoubleStrikeThrough(boolean value)

public void setDoubleStrikeThrough(boolean value)

True if the font is formatted as double strikethrough text.

Parameters:

Parameter Type Description
value boolean The corresponding boolean value.

setEmboss(boolean value)

public void setEmboss(boolean value)

True if the font is formatted as embossed.

Parameters:

Parameter Type Description
value boolean The corresponding boolean value.

setEmphasisMark(int value)

public void setEmphasisMark(int value)

Sets the emphasis mark applied to this formatting.

Parameters:

Parameter Type Description
value int The emphasis mark applied to this formatting. The value must be one of EmphasisMark constants.

setEngrave(boolean value)

public void setEngrave(boolean value)

True if the font is formatted as engraved.

Parameters:

Parameter Type Description
value boolean The corresponding boolean value.

setFillableBackColor(Color value)

public void setFillableBackColor(Color value)

Parameters:

Parameter Type Description
value java.awt.Color

setFillableForeColor(Color value)

public void setFillableForeColor(Color value)

Parameters:

Parameter Type Description
value java.awt.Color

setFillableTransparency(double value)

public void setFillableTransparency(double value)

Parameters:

Parameter Type Description
value double

setFillableVisible(boolean value)

public void setFillableVisible(boolean value)

Parameters:

Parameter Type Description
value boolean

setFilledColor(Color value)

public void setFilledColor(Color value)

Parameters:

Parameter Type Description
value java.awt.Color

setGradientAngle(double value)

public void setGradientAngle(double value)

Parameters:

Parameter Type Description
value double

setHidden(boolean value)

public void setHidden(boolean value)

True if the font is formatted as hidden text.

Parameters:

Parameter Type Description
value boolean The corresponding boolean value.

setHighlightColor(Color value)

public void setHighlightColor(Color value)

Sets the highlight (marker) color.

Parameters:

Parameter Type Description
value java.awt.Color The highlight (marker) color.

setImage(byte[] imageBytes)

public void setImage(byte[] imageBytes)

Parameters:

Parameter Type Description
imageBytes byte[]

setItalic(boolean value)

public void setItalic(boolean value)

True if the font is formatted as italic.

Parameters:

Parameter Type Description
value boolean The corresponding boolean value.

setItalicBi(boolean value)

public void setItalicBi(boolean value)

True if the right-to-left text is formatted as italic.

Parameters:

Parameter Type Description
value boolean The corresponding boolean value.

setKerning(double value)

public void setKerning(double value)

Sets the font size at which kerning starts.

Parameters:

Parameter Type Description
value double The font size at which kerning starts.

setLocaleId(int value)

public void setLocaleId(int value)

Sets the locale identifier (language) of the formatted characters. For the list of locale identifiers see https://msdn.microsoft.com/en-us/library/cc233965.aspx

Parameters:

Parameter Type Description
value int The locale identifier (language) of the formatted characters.

setLocaleIdBi(int value)

public void setLocaleIdBi(int value)

Sets the locale identifier (language) of the formatted right-to-left characters. For the list of locale identifiers see https://msdn.microsoft.com/en-us/library/cc233965.aspx

Parameters:

Parameter Type Description
value int The locale identifier (language) of the formatted right-to-left characters.

setLocaleIdFarEast(int value)

public void setLocaleIdFarEast(int value)

Sets the locale identifier (language) of the formatted Asian characters. For the list of locale identifiers see https://msdn.microsoft.com/en-us/library/cc233965.aspx

Parameters:

Parameter Type Description
value int The locale identifier (language) of the formatted Asian characters.

setName(String value)

public void setName(String value)

Sets the name of the font.

When getting, returns getNameAscii() / setNameAscii(java.lang.String).

When setting, sets getNameAscii() / setNameAscii(java.lang.String), getNameBi() / setNameBi(java.lang.String), getNameFarEast() / setNameFarEast(java.lang.String) and getNameOther() / setNameOther(java.lang.String) to the specified value.

Parameters:

Parameter Type Description
value java.lang.String The name of the font.

setNameAscii(String value)

public void setNameAscii(String value)

Sets the font used for Latin text (characters with character codes from 0 (zero) through 127).

Parameters:

Parameter Type Description
value java.lang.String The font used for Latin text (characters with character codes from 0 (zero) through 127).

setNameBi(String value)

public void setNameBi(String value)

Sets the name of the font in a right-to-left language document.

Parameters:

Parameter Type Description
value java.lang.String The name of the font in a right-to-left language document.

setNameFarEast(String value)

public void setNameFarEast(String value)

Sets an East Asian font name.

Parameters:

Parameter Type Description
value java.lang.String An East Asian font name.

setNameOther(String value)

public void setNameOther(String value)

Sets the font used for characters with character codes from 128 through 255.

Parameters:

Parameter Type Description
value java.lang.String The font used for characters with character codes from 128 through 255.

setNoProofing(boolean value)

public void setNoProofing(boolean value)

True when the formatted characters are not to be spell checked.

Parameters:

Parameter Type Description
value boolean The corresponding boolean value.

setOn(boolean value)

public void setOn(boolean value)

Parameters:

Parameter Type Description
value boolean

setOpacity(double value)

public void setOpacity(double value)

Parameters:

Parameter Type Description
value double

setOutline(boolean value)

public void setOutline(boolean value)

True if the font is formatted as outline.

Parameters:

Parameter Type Description
value boolean The corresponding boolean value.

setPosition(double value)

public void setPosition(double value)

Sets the position of text (in points) relative to the base line. A positive number raises the text, and a negative number lowers it.

Parameters:

Parameter Type Description
value double The position of text (in points) relative to the base line.

setRotateWithObject(boolean value)

public void setRotateWithObject(boolean value)

Parameters:

Parameter Type Description
value boolean

setScaling(int value)

public void setScaling(int value)

Sets character width scaling in percent.

Parameters:

Parameter Type Description
value int Character width scaling in percent.

setShadow(boolean value)

public void setShadow(boolean value)

True if the font is formatted as shadowed.

Parameters:

Parameter Type Description
value boolean The corresponding boolean value.

setSize(double value)

public void setSize(double value)

Sets the font size in points.

Parameters:

Parameter Type Description
value double The font size in points.

setSizeBi(double value)

public void setSizeBi(double value)

Sets the font size in points used in a right-to-left document.

Parameters:

Parameter Type Description
value double The font size in points used in a right-to-left document.

setSmallCaps(boolean value)

public void setSmallCaps(boolean value)

True if the font is formatted as small capital letters.

Parameters:

Parameter Type Description
value boolean The corresponding boolean value.

setSnapToGrid(boolean value)

public void setSnapToGrid(boolean value)

Specifies whether the current font should use the document grid characters per line settings when laying out.

Parameters:

Parameter Type Description
value boolean The corresponding boolean value.

setSpacing(double value)

public void setSpacing(double value)

Sets the spacing (in points) between characters .

Parameters:

Parameter Type Description
value double The spacing (in points) between characters .

setStrikeThrough(boolean value)

public void setStrikeThrough(boolean value)

True if the font is formatted as strikethrough text.

Parameters:

Parameter Type Description
value boolean The corresponding boolean value.

setStyle(Style value)

public void setStyle(Style value)

Sets the character style applied to this formatting.

Parameters:

Parameter Type Description
value Style The character style applied to this formatting.

setStyleIdentifier(int value)

public void setStyleIdentifier(int value)

Sets the locale independent style identifier of the character style applied to this formatting.

Parameters:

Parameter Type Description
value int The locale independent style identifier of the character style applied to this formatting. The value must be one of StyleIdentifier constants.

setStyleName(String value)

public void setStyleName(String value)

Sets the name of the character style applied to this formatting.

Parameters:

Parameter Type Description
value java.lang.String The name of the character style applied to this formatting.

setSubscript(boolean value)

public void setSubscript(boolean value)

True if the font is formatted as subscript.

Parameters:

Parameter Type Description
value boolean The corresponding boolean value.

setSuperscript(boolean value)

public void setSuperscript(boolean value)

True if the font is formatted as superscript.

Parameters:

Parameter Type Description
value boolean The corresponding boolean value.

setTextEffect(int value)

public void setTextEffect(int value)

Sets the font animation effect.

Parameters:

Parameter Type Description
value int The font animation effect. The value must be one of TextEffect constants.

setTextureAlignment(int value)

public void setTextureAlignment(int value)

Parameters:

Parameter Type Description
value int

setThemeColor(int value)

public void setThemeColor(int value)

Sets the theme color in the applied color scheme that is associated with this Font object.

Parameters:

Parameter Type Description
value int The theme color in the applied color scheme that is associated with this Font object. The value must be one of ThemeColor constants.

setThemeFont(int value)

public void setThemeFont(int value)

Sets the theme font in the applied font scheme that is associated with this Font object.

Parameters:

Parameter Type Description
value int The theme font in the applied font scheme that is associated with this Font object. The value must be one of ThemeFont constants.

setThemeFontAscii(int value)

public void setThemeFontAscii(int value)

Sets the theme font used for Latin text (characters with character codes from 0 (zero) through 127) in the applied font scheme that is associated with this Font object.

Parameters:

Parameter Type Description
value int The theme font used for Latin text (characters with character codes from 0 (zero) through 127) in the applied font scheme that is associated with this Font object. The value must be one of ThemeFont constants.

setThemeFontBi(int value)

public void setThemeFontBi(int value)

Sets the theme font in the applied font scheme that is associated with this Font object in a right-to-left language document.

Parameters:

Parameter Type Description
value int The theme font in the applied font scheme that is associated with this Font object in a right-to-left language document. The value must be one of ThemeFont constants.

setThemeFontFarEast(int value)

public void setThemeFontFarEast(int value)

Sets the East Asian theme font in the applied font scheme that is associated with this Font object.

Parameters:

Parameter Type Description
value int The East Asian theme font in the applied font scheme that is associated with this Font object. The value must be one of ThemeFont constants.

setThemeFontOther(int value)

public void setThemeFontOther(int value)

Sets the theme font used for characters with character codes from 128 through 255 in the applied font scheme that is associated with this Font object.

Parameters:

Parameter Type Description
value int The theme font used for characters with character codes from 128 through 255 in the applied font scheme that is associated with this Font object. The value must be one of ThemeFont constants.

setTintAndShade(double value)

public void setTintAndShade(double value)

Sets a double value that lightens or darkens a color.

The allowed values are in range from -1 (darkest) to 1 (lightest) for this property. Zero (0) is neutral. Attempting to set this property to a value less than -1 or more than 1 results in a java.lang.IllegalArgumentException.

Setting this property for Font object with non-theme colors results in a java.lang.IllegalStateException.

Parameters:

Parameter Type Description
value double A double value that lightens or darkens a color.

setUnderline(int value)

public void setUnderline(int value)

Sets the type of underline applied to the font.

Parameters:

Parameter Type Description
value int The type of underline applied to the font. The value must be one of Underline constants.

setUnderlineColor(Color value)

public void setUnderlineColor(Color value)

Sets the color of the underline applied to the font.

Parameters:

Parameter Type Description
value java.awt.Color The color of the underline applied to the font.

solid()

public void solid()

toString()

public String toString()

Returns: java.lang.String

twoColorGradient(int style, int variant)

public void twoColorGradient(int style, int variant)

Parameters:

Parameter Type Description
style int
variant int

wait()

public final void wait()

wait(long arg0)

public final native void wait(long arg0)

Parameters:

Parameter Type Description
arg0 long

wait(long arg0, int arg1)

public final void wait(long arg0, int arg1)

Parameters:

Parameter Type Description
arg0 long
arg1 int