com.aspose.words
Class Font

java.lang.Object
    extended by com.aspose.words.Font

public class Font 
extends java.lang.Object

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

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.


Property Getters/Setters Summary
booleangetAllCaps()
voidsetAllCaps(boolean value)
           True if the font is formatted as all capital letters.
java.awt.ColorgetAutoColor()
           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 Color.
booleangetBidi()
voidsetBidi(boolean value)
           Specifies whether the contents of this run shall have right-to-left characteristics.
booleangetBold()
voidsetBold(boolean value)
           True if the font is formatted as bold.
booleangetBoldBi()
voidsetBoldBi(boolean value)
           True if the right-to-left text is formatted as bold.
BordergetBorder()
           Returns a Border object that specifies border for the font.
java.awt.ColorgetColor()
           Gets or sets the color of the font.
booleangetComplexScript()
voidsetComplexScript(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.
booleangetDoubleStrikeThrough()
voidsetDoubleStrikeThrough(boolean value)
           True if the font is formatted as double strikethrough text.
booleangetEmboss()
voidsetEmboss(boolean value)
           True if the font is formatted as embossed.
booleangetEngrave()
voidsetEngrave(boolean value)
           True if the font is formatted as engraved.
booleangetHidden()
voidsetHidden(boolean value)
           True if the font is formatted as hidden text.
java.awt.ColorgetHighlightColor()
           Gets or sets the highlight (marker) color.
booleangetItalic()
voidsetItalic(boolean value)
           True if the font is formatted as italic.
booleangetItalicBi()
voidsetItalicBi(boolean value)
           True if the right-to-left text is formatted as italic.
doublegetKerning()
voidsetKerning(double value)
           Gets or sets the font size at which kerning starts.
intgetLocaleId()
voidsetLocaleId(int value)
           Gets or sets the locale identifier (language) of the formatted characters.
intgetLocaleIdBi()
voidsetLocaleIdBi(int value)
           Gets or sets the locale identifier (language) of the formatted right-to-left characters.
intgetLocaleIdFarEast()
voidsetLocaleIdFarEast(int value)
           Gets or sets the locale identifier (language) of the formatted Asian characters.
java.lang.StringgetName()
voidsetName(java.lang.String value)
           Gets or sets the name of the font.
java.lang.StringgetNameAscii()
voidsetNameAscii(java.lang.String value)
           Returns or sets the font used for Latin text (characters with character codes from 0 (zero) through 127).
java.lang.StringgetNameBi()
voidsetNameBi(java.lang.String value)
           Returns or sets the name of the font in a right-to-left language document.
java.lang.StringgetNameFarEast()
voidsetNameFarEast(java.lang.String value)
           Returns or sets an East Asian font name.
java.lang.StringgetNameOther()
voidsetNameOther(java.lang.String value)
           Returns or sets the font used for characters with character codes from 128 through 255.
booleangetNoProofing()
voidsetNoProofing(boolean value)
           True when the formatted characters are not to be spell checked.
booleangetOutline()
voidsetOutline(boolean value)
           True if the font is formatted as outline.
doublegetPosition()
voidsetPosition(double value)
           Gets or sets the position of text (in points) relative to the base line. A positive number raises the text, and a negative number lowers it.
intgetScaling()
voidsetScaling(int value)
           Gets or sets character width scaling in percent.
ShadinggetShading()
           Returns a Shading object that refers to the shading formatting for the font.
booleangetShadow()
voidsetShadow(boolean value)
           True if the font is formatted as shadowed.
doublegetSize()
voidsetSize(double value)
           Gets or sets the font size in points.
doublegetSizeBi()
voidsetSizeBi(double value)
           Gets or sets the font size in points used in a right-to-left document.
booleangetSmallCaps()
voidsetSmallCaps(boolean value)
           True if the font is formatted as small capital letters.
doublegetSpacing()
voidsetSpacing(double value)
           Returns or sets the spacing (in points) between characters .
booleangetStrikeThrough()
voidsetStrikeThrough(boolean value)
           True if the font is formatted as strikethrough text.
StylegetStyle()
voidsetStyle(Style value)
           Gets or sets the character style applied to this formatting.
intgetStyleIdentifier()
voidsetStyleIdentifier(int value)
           Gets or sets the locale independent style identifier of the character style applied to this formatting. The value of the property is StyleIdentifier integer constant.
java.lang.StringgetStyleName()
voidsetStyleName(java.lang.String value)
           Gets or sets the name of the character style applied to this formatting.
booleangetSubscript()
voidsetSubscript(boolean value)
           True if the font is formatted as subscript.
booleangetSuperscript()
voidsetSuperscript(boolean value)
           True if the font is formatted as superscript.
intgetTextEffect()
voidsetTextEffect(int value)
           Gets or sets the font animation effect. The value of the property is TextEffect integer constant.
intgetUnderline()
voidsetUnderline(int value)
           Gets or sets the type of underline applied to the font. The value of the property is Underline integer constant.
java.awt.ColorgetUnderlineColor()
           Gets or sets the color of the underline applied to the font.
 
Method Summary
voidclearFormatting()
           Resets to default font formatting.
java.lang.ObjectfetchInheritedBorderAttr(int key)
          Reserved for internal use.
java.lang.ObjectfetchInheritedShadingAttr(int key)
          Reserved for internal use.
java.lang.ObjectgetDirectBorderAttr(int key)
          Reserved for internal use.
java.util.TreeMapgetPossibleBorderKeys()
          Reserved for internal use.
voidsetBorderAttr(int key, java.lang.Object value)
          Reserved for internal use.
 

Property Getters/Setters Detail

getAllCaps/setAllCaps

public boolean getAllCaps() / public void setAllCaps(boolean value)
True if the font is formatted as all capital letters.

getAutoColor

public java.awt.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 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.


getBidi/setBidi

public boolean getBidi() / 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 BoldBi, ItalicBi, SizeBi 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".


getBold/setBold

public boolean getBold() / public void setBold(boolean value)
True if the font is formatted as bold.

getBoldBi/setBoldBi

public boolean getBoldBi() / public void setBoldBi(boolean value)
True if the right-to-left text is formatted as bold.

getBorder

public Border getBorder()
Returns a Border object that specifies border for the font.

getColor

public java.awt.Color getColor()
Gets or sets the color of the font.

getComplexScript/setComplexScript

public boolean getComplexScript() / 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.

getDoubleStrikeThrough/setDoubleStrikeThrough

public boolean getDoubleStrikeThrough() / public void setDoubleStrikeThrough(boolean value)
True if the font is formatted as double strikethrough text.

getEmboss/setEmboss

public boolean getEmboss() / public void setEmboss(boolean value)
True if the font is formatted as embossed.

getEngrave/setEngrave

public boolean getEngrave() / public void setEngrave(boolean value)
True if the font is formatted as engraved.

getHidden/setHidden

public boolean getHidden() / public void setHidden(boolean value)
True if the font is formatted as hidden text.

getHighlightColor

public java.awt.Color getHighlightColor()
Gets or sets the highlight (marker) color.

getItalic/setItalic

public boolean getItalic() / public void setItalic(boolean value)
True if the font is formatted as italic.

getItalicBi/setItalicBi

public boolean getItalicBi() / public void setItalicBi(boolean value)
True if the right-to-left text is formatted as italic.

getKerning/setKerning

public double getKerning() / public void setKerning(double value)
Gets or sets the font size at which kerning starts.

getLocaleId/setLocaleId

public int getLocaleId() / public void setLocaleId(int value)
Gets or sets the locale identifier (language) of the formatted characters. For the list of locale identifiers see http://www.microsoft.com/globaldev/reference/lcid-all.mspx.

getLocaleIdBi/setLocaleIdBi

public int getLocaleIdBi() / public void setLocaleIdBi(int value)
Gets or sets the locale identifier (language) of the formatted right-to-left characters. For the list of locale identifiers see http://www.microsoft.com/globaldev/reference/lcid-all.mspx

getLocaleIdFarEast/setLocaleIdFarEast

public int getLocaleIdFarEast() / public void setLocaleIdFarEast(int value)
Gets or sets the locale identifier (language) of the formatted Asian characters. For the list of locale identifiers see http://www.microsoft.com/globaldev/reference/lcid-all.mspx

getName/setName

public java.lang.String getName() / public void setName(java.lang.String value)
Gets or sets the name of the font.

When getting, returns NameAscii.

When setting, sets NameAscii, NameBi, NameFarEast and NameOther to the specified value.


getNameAscii/setNameAscii

public java.lang.String getNameAscii() / public void setNameAscii(java.lang.String value)
Returns or sets the font used for Latin text (characters with character codes from 0 (zero) through 127).
See Also:
Name

getNameBi/setNameBi

public java.lang.String getNameBi() / public void setNameBi(java.lang.String value)
Returns or sets the name of the font in a right-to-left language document.
See Also:
Name

getNameFarEast/setNameFarEast

public java.lang.String getNameFarEast() / public void setNameFarEast(java.lang.String value)
Returns or sets an East Asian font name.
See Also:
Name

getNameOther/setNameOther

public java.lang.String getNameOther() / public void setNameOther(java.lang.String value)
Returns or sets the font used for characters with character codes from 128 through 255.
See Also:
Name

getNoProofing/setNoProofing

public boolean getNoProofing() / public void setNoProofing(boolean value)
True when the formatted characters are not to be spell checked.

getOutline/setOutline

public boolean getOutline() / public void setOutline(boolean value)
True if the font is formatted as outline.

getPosition/setPosition

public double getPosition() / public void setPosition(double value)
Gets or sets the position of text (in points) relative to the base line. A positive number raises the text, and a negative number lowers it.

getScaling/setScaling

public int getScaling() / public void setScaling(int value)
Gets or sets character width scaling in percent.

getShading

public Shading getShading()
Returns a Shading object that refers to the shading formatting for the font.

getShadow/setShadow

public boolean getShadow() / public void setShadow(boolean value)
True if the font is formatted as shadowed.

getSize/setSize

public double getSize() / public void setSize(double value)
Gets or sets the font size in points.

getSizeBi/setSizeBi

public double getSizeBi() / public void setSizeBi(double value)
Gets or sets the font size in points used in a right-to-left document.

getSmallCaps/setSmallCaps

public boolean getSmallCaps() / public void setSmallCaps(boolean value)
True if the font is formatted as small capital letters.

getSpacing/setSpacing

public double getSpacing() / public void setSpacing(double value)
Returns or sets the spacing (in points) between characters .

getStrikeThrough/setStrikeThrough

public boolean getStrikeThrough() / public void setStrikeThrough(boolean value)
True if the font is formatted as strikethrough text.

getStyle/setStyle

public Style getStyle() / public void setStyle(Style value)
Gets or sets the character style applied to this formatting.

getStyleIdentifier/setStyleIdentifier

public int getStyleIdentifier() / public void setStyleIdentifier(int value)
Gets or sets the locale independent style identifier of the character style applied to this formatting. The value of the property is StyleIdentifier integer constant.

getStyleName/setStyleName

public java.lang.String getStyleName() / public void setStyleName(java.lang.String value)
Gets or sets the name of the character style applied to this formatting.

getSubscript/setSubscript

public boolean getSubscript() / public void setSubscript(boolean value)
True if the font is formatted as subscript.

getSuperscript/setSuperscript

public boolean getSuperscript() / public void setSuperscript(boolean value)
True if the font is formatted as superscript.

getTextEffect/setTextEffect

public int getTextEffect() / public void setTextEffect(int value)
Gets or sets the font animation effect. The value of the property is TextEffect integer constant.

getUnderline/setUnderline

public int getUnderline() / public void setUnderline(int value)
Gets or sets the type of underline applied to the font. The value of the property is Underline integer constant.

getUnderlineColor

public java.awt.Color getUnderlineColor()
Gets or sets the color of the underline applied to the font.

Method Detail

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.


fetchInheritedBorderAttr

public java.lang.Object fetchInheritedBorderAttr(int key)
Reserved for internal use.

fetchInheritedShadingAttr

public java.lang.Object fetchInheritedShadingAttr(int key)
Reserved for internal use.

getDirectBorderAttr

public java.lang.Object getDirectBorderAttr(int key)
Reserved for internal use.

getPossibleBorderKeys

public java.util.TreeMap getPossibleBorderKeys()
Reserved for internal use.

setBorderAttr

public void setBorderAttr(int key, java.lang.Object value)
Reserved for internal use.

See Also:
          Aspose.Words Documentation - the home page for the Aspose.Words Product Documentation.
          Aspose.Words Support Forum - our preferred method of support.