ASPOSE home

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.
booleangetBidi()
voidsetBidi(boolean value)
           True if the formatted characters are right-to-left.
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()
voidsetColor(java.awt.Color value)
           Gets or sets the color of the font.
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()
voidsetHighlightColor(java.awt.Color value)
           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 of 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.
bytegetUnderline()
voidsetUnderline(byte value)
           Gets or sets the type of underline applied to the font. The value of the property is Underline integer constant.
java.awt.ColorgetUnderlineColor()
voidsetUnderlineColor(java.awt.Color value)
           Gets or sets the color of the underline applied to the font.
 
Method Summary
voidclearFormatting()
           Resets to default font formatting.
java.lang.ObjectfetchInheritedAttr(int key)
          Reserved for internal use.
java.lang.ObjectgetDirectAttr(int key)
          Reserved for internal use.
voidsetAttr(int key, java.lang.Object value)
          Reserved for internal use.
 

Property Getters/Setters Detail

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

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.

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.

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.

getColor/setColor

public java.awt.Color getColor()

public void setColor(java.awt.Color value)
Gets or sets the color of the font.

getStrikeThrough/setStrikeThrough

public boolean getStrikeThrough()

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

getDoubleStrikeThrough/setDoubleStrikeThrough

public boolean getDoubleStrikeThrough()

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

getShadow/setShadow

public boolean getShadow()

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

getOutline/setOutline

public boolean getOutline()

public void setOutline(boolean value)
True of the font is formatted as outline.

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.

getSuperscript/setSuperscript

public boolean getSuperscript()

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

getSubscript/setSubscript

public boolean getSubscript()

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

getSmallCaps/setSmallCaps

public boolean getSmallCaps()

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

getAllCaps/setAllCaps

public boolean getAllCaps()

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

getHidden/setHidden

public boolean getHidden()

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

getUnderline/setUnderline

public byte getUnderline()

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

getUnderlineColor/setUnderlineColor

public java.awt.Color getUnderlineColor()

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

getScaling/setScaling

public int getScaling()

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

getSpacing/setSpacing

public double getSpacing()

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

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.

getKerning/setKerning

public double getKerning()

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

getHighlightColor/setHighlightColor

public java.awt.Color getHighlightColor()

public void setHighlightColor(java.awt.Color value)
Gets or sets the highlight (marker) color.

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.

getBidi/setBidi

public boolean getBidi()

public void setBidi(boolean value)
True if the formatted characters are right-to-left.

When true, specifies that this run contains right-to-left text.


getNoProofing/setNoProofing

public boolean getNoProofing()

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

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

getBorder

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

getShading

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

getStyle/setStyle

public Style getStyle()

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

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.

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.

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.


setAttr

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

fetchInheritedAttr

public java.lang.Object fetchInheritedAttr(int key)
                         throws java.lang.Exception
Reserved for internal use.

getDirectAttr

public java.lang.Object getDirectAttr(int key)
                    throws java.lang.Exception
Reserved for internal use.

See Also:
          Wiki - the home page for the Aspose.Words Product Documentation that includes Programmer's Guide, Knowledge Base and other articles.
          Aspose.Words Support Forum - our preferred method of support.
          Aspose.Words Team - contact Aspose.Words Team.


ASPOSE home