Aspose::Words::Font Class Reference

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

#include "Aspose.Words.Cpp/Model/Text/Font.h"

Inherits IBorderAttrSource, and IShadingAttrSource.

Public Member Functions

System::String get_Name ()
 Gets or sets the name of the font. More...
 
void set_Name (System::String value)
 Setter for Aspose::Words::Font::get_Name. More...
 
System::String get_NameAscii ()
 Returns or sets the font used for Latin text (characters with character codes from 0 (zero) through 127). More...
 
void set_NameAscii (System::String value)
 Setter for Aspose::Words::Font::get_NameAscii. More...
 
System::String get_NameBi ()
 Returns or sets the name of the font in a right-to-left language document. More...
 
void set_NameBi (System::String value)
 Setter for Aspose::Words::Font::get_NameBi. More...
 
System::String get_NameFarEast ()
 Returns or sets an East Asian font name. More...
 
void set_NameFarEast (System::String value)
 Setter for Aspose::Words::Font::get_NameFarEast. More...
 
System::String get_NameOther ()
 Returns or sets the font used for characters with character codes from 128 through 255. More...
 
void set_NameOther (System::String value)
 Setter for Aspose::Words::Font::get_NameOther. More...
 
double get_Size ()
 Gets or sets the font size in points. More...
 
void set_Size (double value)
 Setter for Aspose::Words::Font::get_Size. More...
 
double get_SizeBi ()
 Gets or sets the font size in points used in a right-to-left document. More...
 
void set_SizeBi (double value)
 Setter for Aspose::Words::Font::get_SizeBi. More...
 
bool get_Bold ()
 True if the font is formatted as bold. More...
 
void set_Bold (bool value)
 Setter for Aspose::Words::Font::get_Bold. More...
 
bool get_BoldBi ()
 True if the right-to-left text is formatted as bold. More...
 
void set_BoldBi (bool value)
 Setter for Aspose::Words::Font::get_BoldBi. More...
 
bool get_Italic ()
 True if the font is formatted as italic. More...
 
void set_Italic (bool value)
 Setter for Aspose::Words::Font::get_Italic. More...
 
bool get_ItalicBi ()
 True if the right-to-left text is formatted as italic. More...
 
void set_ItalicBi (bool value)
 Setter for Aspose::Words::Font::get_ItalicBi. More...
 
System::Drawing::Color get_Color ()
 Gets or sets the color of the font. More...
 
void set_Color (System::Drawing::Color value)
 Setter for Aspose::Words::Font::get_Color. More...
 
System::Drawing::Color get_AutoColor ()
 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 Aspose::Words::Font::get_Color. More...
 
bool get_StrikeThrough ()
 True if the font is formatted as strikethrough text. More...
 
void set_StrikeThrough (bool value)
 Setter for Aspose::Words::Font::get_StrikeThrough. More...
 
bool get_DoubleStrikeThrough ()
 True if the font is formatted as double strikethrough text. More...
 
void set_DoubleStrikeThrough (bool value)
 Setter for Aspose::Words::Font::get_DoubleStrikeThrough. More...
 
bool get_Shadow ()
 True if the font is formatted as shadowed. More...
 
void set_Shadow (bool value)
 Setter for Aspose::Words::Font::get_Shadow. More...
 
bool get_Outline ()
 True if the font is formatted as outline. More...
 
void set_Outline (bool value)
 Setter for Aspose::Words::Font::get_Outline. More...
 
bool get_Emboss ()
 True if the font is formatted as embossed. More...
 
void set_Emboss (bool value)
 Setter for Aspose::Words::Font::get_Emboss. More...
 
bool get_Engrave ()
 True if the font is formatted as engraved. More...
 
void set_Engrave (bool value)
 Setter for Aspose::Words::Font::get_Engrave. More...
 
bool get_Superscript ()
 True if the font is formatted as superscript. More...
 
void set_Superscript (bool value)
 Setter for Aspose::Words::Font::get_Superscript. More...
 
bool get_Subscript ()
 True if the font is formatted as subscript. More...
 
void set_Subscript (bool value)
 Setter for Aspose::Words::Font::get_Subscript. More...
 
bool get_SmallCaps ()
 True if the font is formatted as small capital letters. More...
 
void set_SmallCaps (bool value)
 Setter for Aspose::Words::Font::get_SmallCaps. More...
 
bool get_AllCaps ()
 True if the font is formatted as all capital letters. More...
 
void set_AllCaps (bool value)
 Setter for Aspose::Words::Font::get_AllCaps. More...
 
bool get_Hidden ()
 True if the font is formatted as hidden text. More...
 
void set_Hidden (bool value)
 Setter for Aspose::Words::Font::get_Hidden. More...
 
Aspose::Words::Underline get_Underline ()
 Gets or sets the type of underline applied to the font. More...
 
void set_Underline (Aspose::Words::Underline value)
 Setter for Aspose::Words::Font::get_Underline. More...
 
System::Drawing::Color get_UnderlineColor ()
 Gets or sets the color of the underline applied to the font. More...
 
void set_UnderlineColor (System::Drawing::Color value)
 Setter for Aspose::Words::Font::get_UnderlineColor. More...
 
int32_t get_Scaling ()
 Gets or sets character width scaling in percent. More...
 
void set_Scaling (int32_t value)
 Setter for Aspose::Words::Font::get_Scaling. More...
 
double get_Spacing ()
 Returns or sets the spacing (in points) between characters . More...
 
void set_Spacing (double value)
 Setter for Aspose::Words::Font::get_Spacing. More...
 
double get_LineSpacing ()
 Returns line spacing of this font (in points). More...
 
double get_Position ()
 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. More...
 
void set_Position (double value)
 Setter for Aspose::Words::Font::get_Position. More...
 
double get_Kerning ()
 Gets or sets the font size at which kerning starts. More...
 
void set_Kerning (double value)
 Setter for Aspose::Words::Font::get_Kerning. More...
 
System::Drawing::Color get_HighlightColor ()
 Gets or sets the highlight (marker) color. More...
 
void set_HighlightColor (System::Drawing::Color value)
 Setter for Aspose::Words::Font::get_HighlightColor. More...
 
Aspose::Words::TextEffect get_TextEffect ()
 Gets or sets the font animation effect. More...
 
void set_TextEffect (Aspose::Words::TextEffect value)
 Setter for Aspose::Words::Font::get_TextEffect. More...
 
bool get_Bidi ()
 Specifies whether the contents of this run shall have right-to-left characteristics. More...
 
void set_Bidi (bool value)
 Setter for Aspose::Words::Font::get_Bidi. More...
 
bool get_ComplexScript ()
 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. More...
 
void set_ComplexScript (bool value)
 Setter for Aspose::Words::Font::get_ComplexScript. More...
 
bool get_NoProofing ()
 True when the formatted characters are not to be spell checked. More...
 
void set_NoProofing (bool value)
 Setter for Aspose::Words::Font::get_NoProofing. More...
 
int32_t get_LocaleId ()
 Gets or sets the locale identifier (language) of the formatted characters. More...
 
void set_LocaleId (int32_t value)
 Setter for Aspose::Words::Font::get_LocaleId. More...
 
int32_t get_LocaleIdBi ()
 Gets or sets the locale identifier (language) of the formatted right-to-left characters. More...
 
void set_LocaleIdBi (int32_t value)
 Setter for Aspose::Words::Font::get_LocaleIdBi. More...
 
int32_t get_LocaleIdFarEast ()
 Gets or sets the locale identifier (language) of the formatted Asian characters. More...
 
void set_LocaleIdFarEast (int32_t value)
 Setter for Aspose::Words::Font::get_LocaleIdFarEast. More...
 
System::SharedPtr< Aspose::Words::Borderget_Border ()
 Returns a Border object that specifies border for the font. More...
 
System::SharedPtr< Aspose::Words::Shadingget_Shading ()
 Returns a Shading object that refers to the shading formatting for the font. More...
 
System::SharedPtr< Aspose::Words::Styleget_Style ()
 Gets or sets the character style applied to this formatting. More...
 
void set_Style (System::SharedPtr< Aspose::Words::Style > value)
 Setter for Aspose::Words::Font::get_Style. More...
 
System::String get_StyleName ()
 Gets or sets the name of the character style applied to this formatting. More...
 
void set_StyleName (System::String value)
 Setter for Aspose::Words::Font::get_StyleName. More...
 
Aspose::Words::StyleIdentifier get_StyleIdentifier ()
 Gets or sets the locale independent style identifier of the character style applied to this formatting. More...
 
void set_StyleIdentifier (Aspose::Words::StyleIdentifier value)
 Setter for Aspose::Words::Font::get_StyleIdentifier. More...
 
System::SharedPtr< System::Collections::Generic::SortedList< Aspose::Words::BorderType, int32_t > > get_PossibleBorderKeys ()
 
void ClearFormatting ()
 Resets to default font formatting. More...
 
bool HasDmlEffect (Aspose::Words::TextDmlEffect dmlEffectType)
 Checks if particular DrawingML text effect is applied. More...
 
System::SharedPtr< System::ObjectGetDirectBorderAttr (int32_t key)
 
System::SharedPtr< System::ObjectFetchInheritedBorderAttr (int32_t key)
 
void SetBorderAttr (int32_t key, System::SharedPtr< System::Object > value)
 
System::SharedPtr< System::ObjectFetchInheritedShadingAttr (int32_t key)
 

Detailed Description

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

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

Member Function Documentation

◆ ClearFormatting()

void Aspose::Words::Font::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()

System::SharedPtr<System::Object> Aspose::Words::Font::FetchInheritedBorderAttr ( int32_t  key)

◆ FetchInheritedShadingAttr()

System::SharedPtr<System::Object> Aspose::Words::Font::FetchInheritedShadingAttr ( int32_t  key)

◆ get_AllCaps()

bool Aspose::Words::Font::get_AllCaps ( )

True if the font is formatted as all capital letters.

◆ get_AutoColor()

System::Drawing::Color Aspose::Words::Font::get_AutoColor ( )

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 Aspose::Words::Font::get_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.

◆ get_Bidi()

bool Aspose::Words::Font::get_Bidi ( )

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 Aspose::Words::Font::get_BoldBi, Aspose::Words::Font::get_ItalicBi, Aspose::Words::Font::get_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".

◆ get_Bold()

bool Aspose::Words::Font::get_Bold ( )

True if the font is formatted as bold.

◆ get_BoldBi()

bool Aspose::Words::Font::get_BoldBi ( )

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

◆ get_Border()

System::SharedPtr<Aspose::Words::Border> Aspose::Words::Font::get_Border ( )

Returns a Border object that specifies border for the font.

◆ get_Color()

System::Drawing::Color Aspose::Words::Font::get_Color ( )

Gets or sets the color of the font.

◆ get_ComplexScript()

bool Aspose::Words::Font::get_ComplexScript ( )

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.

◆ get_DoubleStrikeThrough()

bool Aspose::Words::Font::get_DoubleStrikeThrough ( )

True if the font is formatted as double strikethrough text.

◆ get_Emboss()

bool Aspose::Words::Font::get_Emboss ( )

True if the font is formatted as embossed.

◆ get_Engrave()

bool Aspose::Words::Font::get_Engrave ( )

True if the font is formatted as engraved.

◆ get_Hidden()

bool Aspose::Words::Font::get_Hidden ( )

True if the font is formatted as hidden text.

◆ get_HighlightColor()

System::Drawing::Color Aspose::Words::Font::get_HighlightColor ( )

Gets or sets the highlight (marker) color.

◆ get_Italic()

bool Aspose::Words::Font::get_Italic ( )

True if the font is formatted as italic.

◆ get_ItalicBi()

bool Aspose::Words::Font::get_ItalicBi ( )

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

◆ get_Kerning()

double Aspose::Words::Font::get_Kerning ( )

Gets or sets the font size at which kerning starts.

◆ get_LineSpacing()

double Aspose::Words::Font::get_LineSpacing ( )

Returns line spacing of this font (in points).

◆ get_LocaleId()

int32_t Aspose::Words::Font::get_LocaleId ( )

Gets or 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

◆ get_LocaleIdBi()

int32_t Aspose::Words::Font::get_LocaleIdBi ( )

Gets or 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

◆ get_LocaleIdFarEast()

int32_t Aspose::Words::Font::get_LocaleIdFarEast ( )

Gets or 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

◆ get_Name()

System::String Aspose::Words::Font::get_Name ( )

Gets or sets the name of the font.

When getting, returns Aspose::Words::Font::get_NameAscii.

When setting, sets Aspose::Words::Font::get_NameAscii, Aspose::Words::Font::get_NameBi, Aspose::Words::Font::get_NameFarEast and Aspose::Words::Font::get_NameOther to the specified value.

◆ get_NameAscii()

System::String Aspose::Words::Font::get_NameAscii ( )

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

See also
Aspose::Words::Font::get_Name

◆ get_NameBi()

System::String Aspose::Words::Font::get_NameBi ( )

Returns or sets the name of the font in a right-to-left language document.

See also
Aspose::Words::Font::get_Name

◆ get_NameFarEast()

System::String Aspose::Words::Font::get_NameFarEast ( )

Returns or sets an East Asian font name.

See also
Aspose::Words::Font::get_Name

◆ get_NameOther()

System::String Aspose::Words::Font::get_NameOther ( )

Returns or sets the font used for characters with character codes from 128 through 255.

See also
Aspose::Words::Font::get_Name

◆ get_NoProofing()

bool Aspose::Words::Font::get_NoProofing ( )

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

◆ get_Outline()

bool Aspose::Words::Font::get_Outline ( )

True if the font is formatted as outline.

◆ get_Position()

double Aspose::Words::Font::get_Position ( )

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.

◆ get_PossibleBorderKeys()

System::SharedPtr<System::Collections::Generic::SortedList<Aspose::Words::BorderType, int32_t> > Aspose::Words::Font::get_PossibleBorderKeys ( )

◆ get_Scaling()

int32_t Aspose::Words::Font::get_Scaling ( )

Gets or sets character width scaling in percent.

◆ get_Shading()

System::SharedPtr<Aspose::Words::Shading> Aspose::Words::Font::get_Shading ( )

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

◆ get_Shadow()

bool Aspose::Words::Font::get_Shadow ( )

True if the font is formatted as shadowed.

◆ get_Size()

double Aspose::Words::Font::get_Size ( )

Gets or sets the font size in points.

◆ get_SizeBi()

double Aspose::Words::Font::get_SizeBi ( )

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

◆ get_SmallCaps()

bool Aspose::Words::Font::get_SmallCaps ( )

True if the font is formatted as small capital letters.

◆ get_Spacing()

double Aspose::Words::Font::get_Spacing ( )

Returns or sets the spacing (in points) between characters .

◆ get_StrikeThrough()

bool Aspose::Words::Font::get_StrikeThrough ( )

True if the font is formatted as strikethrough text.

◆ get_Style()

System::SharedPtr<Aspose::Words::Style> Aspose::Words::Font::get_Style ( )

Gets or sets the character style applied to this formatting.

◆ get_StyleIdentifier()

Aspose::Words::StyleIdentifier Aspose::Words::Font::get_StyleIdentifier ( )

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

◆ get_StyleName()

System::String Aspose::Words::Font::get_StyleName ( )

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

◆ get_Subscript()

bool Aspose::Words::Font::get_Subscript ( )

True if the font is formatted as subscript.

◆ get_Superscript()

bool Aspose::Words::Font::get_Superscript ( )

True if the font is formatted as superscript.

◆ get_TextEffect()

Aspose::Words::TextEffect Aspose::Words::Font::get_TextEffect ( )

Gets or sets the font animation effect.

◆ get_Underline()

Aspose::Words::Underline Aspose::Words::Font::get_Underline ( )

Gets or sets the type of underline applied to the font.

◆ get_UnderlineColor()

System::Drawing::Color Aspose::Words::Font::get_UnderlineColor ( )

Gets or sets the color of the underline applied to the font.

◆ GetDirectBorderAttr()

System::SharedPtr<System::Object> Aspose::Words::Font::GetDirectBorderAttr ( int32_t  key)

◆ HasDmlEffect()

bool Aspose::Words::Font::HasDmlEffect ( Aspose::Words::TextDmlEffect  dmlEffectType)

Checks if particular DrawingML text effect is applied.

Parameters
dmlEffectTypeDrawingML text effect type.
Returns
True if particular DrawingML text effect is applied.

◆ set_AllCaps()

void Aspose::Words::Font::set_AllCaps ( bool  value)

◆ set_Bidi()

void Aspose::Words::Font::set_Bidi ( bool  value)

◆ set_Bold()

void Aspose::Words::Font::set_Bold ( bool  value)

◆ set_BoldBi()

void Aspose::Words::Font::set_BoldBi ( bool  value)

◆ set_Color()

void Aspose::Words::Font::set_Color ( System::Drawing::Color  value)

◆ set_ComplexScript()

void Aspose::Words::Font::set_ComplexScript ( bool  value)

◆ set_DoubleStrikeThrough()

void Aspose::Words::Font::set_DoubleStrikeThrough ( bool  value)

◆ set_Emboss()

void Aspose::Words::Font::set_Emboss ( bool  value)

◆ set_Engrave()

void Aspose::Words::Font::set_Engrave ( bool  value)

◆ set_Hidden()

void Aspose::Words::Font::set_Hidden ( bool  value)

◆ set_HighlightColor()

void Aspose::Words::Font::set_HighlightColor ( System::Drawing::Color  value)

◆ set_Italic()

void Aspose::Words::Font::set_Italic ( bool  value)

◆ set_ItalicBi()

void Aspose::Words::Font::set_ItalicBi ( bool  value)

◆ set_Kerning()

void Aspose::Words::Font::set_Kerning ( double  value)

◆ set_LocaleId()

void Aspose::Words::Font::set_LocaleId ( int32_t  value)

◆ set_LocaleIdBi()

void Aspose::Words::Font::set_LocaleIdBi ( int32_t  value)

◆ set_LocaleIdFarEast()

void Aspose::Words::Font::set_LocaleIdFarEast ( int32_t  value)

◆ set_Name()

void Aspose::Words::Font::set_Name ( System::String  value)

◆ set_NameAscii()

void Aspose::Words::Font::set_NameAscii ( System::String  value)

◆ set_NameBi()

void Aspose::Words::Font::set_NameBi ( System::String  value)

◆ set_NameFarEast()

void Aspose::Words::Font::set_NameFarEast ( System::String  value)

◆ set_NameOther()

void Aspose::Words::Font::set_NameOther ( System::String  value)

◆ set_NoProofing()

void Aspose::Words::Font::set_NoProofing ( bool  value)

◆ set_Outline()

void Aspose::Words::Font::set_Outline ( bool  value)

◆ set_Position()

void Aspose::Words::Font::set_Position ( double  value)

◆ set_Scaling()

void Aspose::Words::Font::set_Scaling ( int32_t  value)

◆ set_Shadow()

void Aspose::Words::Font::set_Shadow ( bool  value)

◆ set_Size()

void Aspose::Words::Font::set_Size ( double  value)

◆ set_SizeBi()

void Aspose::Words::Font::set_SizeBi ( double  value)

◆ set_SmallCaps()

void Aspose::Words::Font::set_SmallCaps ( bool  value)

◆ set_Spacing()

void Aspose::Words::Font::set_Spacing ( double  value)

◆ set_StrikeThrough()

void Aspose::Words::Font::set_StrikeThrough ( bool  value)

◆ set_Style()

void Aspose::Words::Font::set_Style ( System::SharedPtr< Aspose::Words::Style value)

◆ set_StyleIdentifier()

void Aspose::Words::Font::set_StyleIdentifier ( Aspose::Words::StyleIdentifier  value)

◆ set_StyleName()

void Aspose::Words::Font::set_StyleName ( System::String  value)

◆ set_Subscript()

void Aspose::Words::Font::set_Subscript ( bool  value)

◆ set_Superscript()

void Aspose::Words::Font::set_Superscript ( bool  value)

◆ set_TextEffect()

void Aspose::Words::Font::set_TextEffect ( Aspose::Words::TextEffect  value)

◆ set_Underline()

void Aspose::Words::Font::set_Underline ( Aspose::Words::Underline  value)

◆ set_UnderlineColor()

void Aspose::Words::Font::set_UnderlineColor ( System::Drawing::Color  value)

◆ SetBorderAttr()

void Aspose::Words::Font::SetBorderAttr ( int32_t  key,
System::SharedPtr< System::Object value 
)