Font

Overview

Font is a class in Aspose.Words FOSS for Java. Inherits from: IBorderAttrSource, IShadingAttrSource, IFillable.

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

Edition status of its 162 listed members (a property and its accessor methods are listed separately, overloads once): 162 not yet exercised by a verified example.

This class declares 107 methods for Font objects in Java programs. Available methods include: clearFormatting, getAllCaps, getAutoColor, getBidi, getBold, getBoldBi, getBorder, getColor, getComplexScript, getDoubleStrikeThrough, getEmboss, getEmphasisMark, and 95 additional methods. Public members are accessible to any Java application after installing the Aspose.Words FOSS for Java package. Properties: allCaps, autoColor, bidi, bold, boldBi, border, and 49 more.

Properties

NameTypeAccessDescription
nameStringRead/WriteGets or sets the name of the font.
nameAsciiStringRead/WriteReturns or sets the font used for Latin text (characters with character codes from 0 (zero) through 127).
nameBiStringRead/WriteReturns or sets the name of the font in a right-to-left language document.
nameFarEastStringRead/WriteReturns or sets an East Asian font name.
nameOtherStringRead/WriteReturns or sets the font used for characters with character codes from 128 through 255.
themeFontintRead/WriteGets or sets the theme font in the applied font scheme that is associated with this Font object.
themeFontAsciiintRead/WriteGets or 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.
themeFontFarEastintRead/WriteGets or sets the East Asian theme font in the applied font scheme that is associated with this Font object.
themeFontOtherintRead/WriteGets or 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.
themeFontBiintRead/WriteGets or sets the theme font in the applied font scheme that is associated with this Font object in a right-to-left language document.
sizedoubleRead/WriteGets or sets the font size in points.
sizeBidoubleRead/WriteGets or sets the font size in points used in a right-to-left document.
boldbooleanRead/WriteTrue if the font is formatted as bold.
boldBibooleanRead/WriteTrue if the right-to-left text is formatted as bold.
italicbooleanRead/WriteTrue if the font is formatted as italic.
italicBibooleanRead/WriteTrue if the right-to-left text is formatted as italic.
colorColorRead/WriteGets or sets the color of the font.
themeColorintRead/WriteGets or sets the theme color in the applied color scheme that is associated with this Font object.
tintAndShadedoubleRead/WriteGets or sets a double value that lightens or darkens a color.
autoColorColorReadReturns the present calculated color of the text (black or white) to be used for ‘auto color’.
strikeThroughbooleanRead/WriteTrue if the font is formatted as strikethrough text.
doubleStrikeThroughbooleanRead/WriteTrue if the font is formatted as double strikethrough text.
shadowbooleanRead/WriteTrue if the font is formatted as shadowed.
outlinebooleanRead/WriteTrue if the font is formatted as outline.
embossbooleanRead/WriteTrue if the font is formatted as embossed.
engravebooleanRead/WriteTrue if the font is formatted as engraved.
superscriptbooleanRead/WriteTrue if the font is formatted as superscript.
subscriptbooleanRead/WriteTrue if the font is formatted as subscript.
smallCapsbooleanRead/WriteTrue if the font is formatted as small capital letters.
allCapsbooleanRead/WriteTrue if the font is formatted as all capital letters.
hiddenbooleanRead/WriteTrue if the font is formatted as hidden text.
underlineintRead/WriteGets or sets the type of underline applied to the font.
underlineColorColorRead/WriteGets or sets the color of the underline applied to the font.
numberSpacingintRead/WriteGets or sets the spacing type of the numeral being displayed.
scalingintRead/WriteGets or sets character width scaling in percent.
spacingdoubleRead/WriteReturns or sets the spacing (in points) between characters .
lineSpacingdoubleReadReturns line spacing of this font (in points).
positiondoubleRead/WriteGets or sets the position of text (in points) relative to the base line.
kerningdoubleRead/WriteGets or sets the font size at which kerning starts.
highlightColorColorRead/WriteGets or sets the highlight (marker) color.
textEffectintRead/WriteGets or sets the font animation effect.
fillFillReadGets fill formatting for the Font.
bidibooleanRead/WriteSpecifies whether the contents of this run shall have right-to-left characteristics.
complexScriptbooleanRead/WriteSpecifies 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.
noProofingbooleanRead/WriteTrue when the formatted characters are not to be spell checked.
localeIdintRead/WriteGets or sets the locale identifier (language) of the formatted characters.
localeIdBiintRead/WriteGets or sets the locale identifier (language) of the formatted right-to-left characters.
localeIdFarEastintRead/WriteGets or sets the locale identifier (language) of the formatted Asian characters.
borderBorderReadReturns a Border object that specifies border for the font.
shadingShadingReadReturns a Shading object that refers to the shading formatting for the font.
styleStyleRead/WriteGets or sets the character style applied to this formatting.
styleNameStringRead/WriteGets or sets the name of the character style applied to this formatting.
styleIdentifierintRead/WriteGets or sets the locale independent style identifier of the character style applied to this formatting.
snapToGridbooleanRead/WriteSpecifies whether the current font should use the document grid characters per line settings when laying out.
emphasisMarkintRead/WriteGets or sets the emphasis mark applied to this formatting.

Methods

SignatureDescription
clearFormatting()Resets to default font formatting.
getName() → StringGets or sets the name of the font.
setName(value: String)Sets the name value.
getNameAscii() → StringReturns or sets the font used for Latin text (characters with character codes from 0 (zero) through 127).
setNameAscii(value: String)Sets the name ascii value.
getNameBi() → StringReturns or sets the name of the font in a right-to-left language document.
setNameBi(value: String)Sets the name bi value.
getNameFarEast() → StringReturns or sets an East Asian font name.
setNameFarEast(value: String)Sets the name far east value.
getNameOther() → StringReturns or sets the font used for characters with character codes from 128 through 255.
setNameOther(value: String)Sets the name other value.
getThemeFont() → intGets or sets the theme font in the applied font scheme that is associated with this Font object.
setThemeFont(value: int)Sets the theme font value.
getThemeFontAscii() → intGets or 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.
setThemeFontAscii(value: int)Sets the theme font ascii value.
getThemeFontFarEast() → intGets or sets the East Asian theme font in the applied font scheme that is associated with this Font object.
setThemeFontFarEast(value: int)Sets the theme font far east value.
getThemeFontOther() → intGets or 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.
setThemeFontOther(value: int)Sets the theme font other value.
getThemeFontBi() → intGets or sets the theme font in the applied font scheme that is associated with this Font object in a right-to-left language document.
setThemeFontBi(value: int)Sets the theme font bi value.
getSize() → doubleGets or sets the font size in points.
setSize(value: double)Sets the size value.
getSizeBi() → doubleGets or sets the font size in points used in a right-to-left document.
setSizeBi(value: double)Sets the size bi value.
getBold() → booleanTrue if the font is formatted as bold.
setBold(value: boolean)Sets the bold value.
getBoldBi() → booleanTrue if the right-to-left text is formatted as bold.
setBoldBi(value: boolean)Sets the bold bi value.
getItalic() → booleanTrue if the font is formatted as italic.
setItalic(value: boolean)Sets the italic value.
getItalicBi() → booleanTrue if the right-to-left text is formatted as italic.
setItalicBi(value: boolean)Sets the italic bi value.
getColor() → ColorGets or sets the color of the font.
setColor(value: Color)Sets the color value.
getThemeColor() → intGets or sets the theme color in the applied color scheme that is associated with this Font object.
setThemeColor(value: int)Sets the theme color value.
getTintAndShade() → doubleGets or sets a double value that lightens or darkens a color.
setTintAndShade(value: double)Sets the tint and shade value.
getAutoColor() → ColorReturns the present calculated color of the text (black or white) to be used for ‘auto color’.
getStrikeThrough() → booleanTrue if the font is formatted as strikethrough text.
setStrikeThrough(value: boolean)Sets the strike through value.
getDoubleStrikeThrough() → booleanTrue if the font is formatted as double strikethrough text.
setDoubleStrikeThrough(value: boolean)Sets the double strike through value.
getShadow() → booleanTrue if the font is formatted as shadowed.
setShadow(value: boolean)Sets the shadow value.
getOutline() → booleanTrue if the font is formatted as outline.
setOutline(value: boolean)Sets the outline value.
getEmboss() → booleanTrue if the font is formatted as embossed.
setEmboss(value: boolean)Sets the emboss value.
getEngrave() → booleanTrue if the font is formatted as engraved.
setEngrave(value: boolean)Sets the engrave value.
getSuperscript() → booleanTrue if the font is formatted as superscript.
setSuperscript(value: boolean)Sets the superscript value.
getSubscript() → booleanTrue if the font is formatted as subscript.
setSubscript(value: boolean)Sets the subscript value.
getSmallCaps() → booleanTrue if the font is formatted as small capital letters.
setSmallCaps(value: boolean)Sets the small caps value.
getAllCaps() → booleanTrue if the font is formatted as all capital letters.
setAllCaps(value: boolean)Sets the all caps value.
getHidden() → booleanTrue if the font is formatted as hidden text.
setHidden(value: boolean)Sets the hidden value.
getUnderline() → intGets or sets the type of underline applied to the font.
setUnderline(value: int)Sets the underline value.
getUnderlineColor() → ColorGets or sets the color of the underline applied to the font.
setUnderlineColor(value: Color)Sets the underline color value.
getNumberSpacing() → intGets or sets the spacing type of the numeral being displayed.
setNumberSpacing(value: int)Sets the number spacing value.
getScaling() → intGets or sets character width scaling in percent.
setScaling(value: int)Sets the scaling value.
getSpacing() → doubleReturns or sets the spacing (in points) between characters .
setSpacing(value: double)Sets the spacing value.
getLineSpacing() → doubleReturns line spacing of this font (in points).
getPosition() → doubleGets or sets the position of text (in points) relative to the base line.
setPosition(value: double)Sets the position value.
getKerning() → doubleGets or sets the font size at which kerning starts.
setKerning(value: double)Sets the kerning value.
getHighlightColor() → ColorGets or sets the highlight (marker) color.
setHighlightColor(value: Color)Sets the highlight color value.
getTextEffect() → intGets or sets the font animation effect.
setTextEffect(value: int)Sets the text effect value.
getFill() → FillGets fill formatting for the Font.
hasDmlEffect(dmlEffectType: int) → booleanChecks if particular DrawingML text effect is applied.
getBidi() → booleanSpecifies whether the contents of this run shall have right-to-left characteristics.
setBidi(value: boolean)Sets the bidi value.
getComplexScript() → booleanSpecifies 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.
setComplexScript(value: boolean)Sets the complex script value.
getNoProofing() → booleanTrue when the formatted characters are not to be spell checked.
setNoProofing(value: boolean)Sets the no proofing value.
getLocaleId() → intGets or sets the locale identifier (language) of the formatted characters.
setLocaleId(value: int)Sets the locale id value.
getLocaleIdBi() → intGets or sets the locale identifier (language) of the formatted right-to-left characters.
setLocaleIdBi(value: int)Sets the locale id bi value.
getLocaleIdFarEast() → intGets or sets the locale identifier (language) of the formatted Asian characters.
setLocaleIdFarEast(value: int)Sets the locale id far east value.
getBorder() → BorderReturns a Border object that specifies border for the font.
getShading() → ShadingReturns a Shading object that refers to the shading formatting for the font.
getStyle() → StyleGets or sets the character style applied to this formatting.
setStyle(value: Style)Sets the style value.
getStyleName() → StringGets or sets the name of the character style applied to this formatting.
setStyleName(value: String)Sets the style name value.
getStyleIdentifier() → intGets or sets the locale independent style identifier of the character style applied to this formatting.
setStyleIdentifier(value: int)Sets the style identifier value.
getSnapToGrid() → booleanSpecifies whether the current font should use the document grid characters per line settings when laying out.
setSnapToGrid(value: boolean)Sets the snap to grid value.
getEmphasisMark() → intGets or sets the emphasis mark applied to this formatting.
setEmphasisMark(value: int)Sets the emphasis mark value.

See Also