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