search/mag_sel search/close

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.

Examples

Shows how to insert a string surrounded by a border into a document.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);
builder->get_Font()->get_Border()->set_Color(System::Drawing::Color::get_Green());
builder->get_Font()->get_Border()->set_LineWidth(2.5);
builder->get_Font()->get_Border()->set_LineStyle(LineStyle::DashDotStroker);
builder->Write(u"Text surrounded by green border.");
doc->Save(ArtifactsDir + u"Border.FontBorder.docx");

Shows how to format a run of text using its font property.

auto doc = MakeObject<Document>();
auto run = MakeObject<Run>(doc, u"Hello world!");
SharedPtr<Aspose::Words::Font> font = run->get_Font();
font->set_Name(u"Courier New");
font->set_Size(36);
font->set_HighlightColor(System::Drawing::Color::get_Yellow());
doc->get_FirstSection()->get_Body()->get_FirstParagraph()->AppendChild(run);
doc->Save(ArtifactsDir + u"Font.CreateFormattedRun.docx");

Shows how to create and use a paragraph style with list formatting.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);
// Create a custom paragraph style.
SharedPtr<Style> style = doc->get_Styles()->Add(StyleType::Paragraph, u"MyStyle1");
style->get_Font()->set_Size(24);
style->get_Font()->set_Name(u"Verdana");
style->get_ParagraphFormat()->set_SpaceAfter(12);
// Create a list and make sure the paragraphs that use this style will use this list.
style->get_ListFormat()->set_List(doc->get_Lists()->Add(ListTemplate::BulletDefault));
style->get_ListFormat()->set_ListLevelNumber(0);
// Apply the paragraph style to the document builder's current paragraph, and then add some text.
builder->get_ParagraphFormat()->set_Style(style);
builder->Writeln(u"Hello World: MyStyle1, bulleted list.");
// Change the document builder's style to one that has no list formatting and write another paragraph.
builder->get_ParagraphFormat()->set_Style(doc->get_Styles()->idx_get(u"Normal"));
builder->Writeln(u"Hello World: Normal.");
builder->get_Document()->Save(ArtifactsDir + u"Styles.ParagraphStyleBulletedList.docx");

#include <Aspose.Words.Cpp/Font.h>

+ Inheritance diagram for Aspose::Words::Font:

Public Member Functions

void ClearFormatting ()
 Resets to default font formatting. More...
 
bool get_AllCaps ()
 True if the font is formatted as all capital letters. More...
 
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 Color. More...
 
Color get_BackColor () override
 
bool get_Bidi ()
 Specifies whether the contents of this run shall have right-to-left characteristics. More...
 
bool get_Bold ()
 True if the font is formatted as bold. More...
 
bool get_BoldBi ()
 True if the right-to-left text is formatted as bold. More...
 
SharedPtr< Borderget_Border ()
 Returns a Border object that specifies border for the font. More...
 
Color get_Color ()
 Gets or sets the color of the font. 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...
 
bool get_DoubleStrikeThrough ()
 True if the font is formatted as double strikethrough text. More...
 
bool get_Emboss ()
 True if the font is formatted as embossed. More...
 
EmphasisMark get_EmphasisMark ()
 Gets or sets the emphasis mark applied to this formatting. More...
 
bool get_Engrave ()
 True if the font is formatted as engraved. More...
 
SharedPtr< Fillget_Fill ()
 Gets fill formatting for the Font. More...
 
Color get_FilledColor () override
 
FillTypeCore get_FillType () override
 
Color get_ForeColor () override
 
bool get_Hidden ()
 True if the font is formatted as hidden text. More...
 
Color get_HighlightColor ()
 Gets or sets the highlight (marker) color. More...
 
ArrayPtr< uint8_t > get_ImageBytes () override
 
bool get_Italic ()
 True if the font is formatted as italic. More...
 
bool get_ItalicBi ()
 True if the right-to-left text is formatted as italic. More...
 
double get_Kerning ()
 Gets or sets the font size at which kerning starts. More...
 
double get_LineSpacing ()
 Returns line spacing of this font (in points). More...
 
int32_t get_LocaleId ()
 Gets or sets the locale identifier (language) of the formatted characters. More...
 
int32_t get_LocaleIdBi ()
 Gets or sets the locale identifier (language) of the formatted right-to-left characters. More...
 
int32_t get_LocaleIdFarEast ()
 Gets or sets the locale identifier (language) of the formatted Asian characters. More...
 
String get_Name ()
 Gets or sets the name of the font. More...
 
String get_NameAscii ()
 Returns or sets the font used for Latin text (characters with character codes from 0 (zero) through 127). More...
 
String get_NameBi ()
 Returns or sets the name of the font in a right-to-left language document. More...
 
String get_NameFarEast ()
 Returns or sets an East Asian font name. More...
 
String get_NameOther ()
 Returns or sets the font used for characters with character codes from 128 through 255. More...
 
bool get_NoProofing ()
 True when the formatted characters are not to be spell checked. More...
 
bool get_On () override
 
double get_Opacity () override
 
bool get_Outline ()
 True if the font is formatted as outline. 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...
 
bool get_RotateWithObject () override
 
int32_t get_Scaling ()
 Gets or sets character width scaling in percent. More...
 
SharedPtr< Shadingget_Shading ()
 Returns a Shading object that refers to the shading formatting for the font. More...
 
bool get_Shadow ()
 True if the font is formatted as shadowed. More...
 
double get_Size ()
 Gets or sets the font size in points. More...
 
double get_SizeBi ()
 Gets or sets the font size in points used in a right-to-left document. More...
 
bool get_SmallCaps ()
 True if the font is formatted as small capital letters. More...
 
bool get_SnapToGrid ()
 Specifies whether the current font should use the document grid characters per line settings when laying out. More...
 
double get_Spacing ()
 Returns or sets the spacing (in points) between characters . More...
 
bool get_StrikeThrough ()
 True if the font is formatted as strikethrough text. More...
 
SharedPtr< Styleget_Style ()
 Gets or sets the character style applied to this formatting. More...
 
StyleIdentifier get_StyleIdentifier ()
 Gets or sets the locale independent style identifier of the character style applied to this formatting. More...
 
String get_StyleName ()
 Gets or sets the name of the character style applied to this formatting. More...
 
bool get_Subscript ()
 True if the font is formatted as subscript. More...
 
bool get_Superscript ()
 True if the font is formatted as superscript. More...
 
TextEffect get_TextEffect ()
 Gets or sets the font animation effect. More...
 
ThemeColor get_ThemeColor ()
 Gets or sets the theme color in the applied color scheme that is associated with this Font object. More...
 
ThemeFont get_ThemeFont ()
 Gets or sets the theme font in the applied font scheme that is associated with this Font object. More...
 
ThemeFont get_ThemeFontAscii ()
 Gets 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. More...
 
ThemeFont get_ThemeFontBi ()
 Gets or sets the theme font in the applied font scheme that is associated with this Font object in a right-to-left language document. More...
 
ThemeFont get_ThemeFontFarEast ()
 Gets or sets the East Asian theme font in the applied font scheme that is associated with this Font object. More...
 
ThemeFont get_ThemeFontOther ()
 Gets 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. More...
 
SharedPtr< Aspose::Words::Drawing::Core::Dml::Themes::IThemeProvider > get_ThemeProvider () override
 
double get_TintAndShade ()
 Gets or sets a double value that lightens or darkens a color. More...
 
double get_Transparency () override
 
Underline get_Underline ()
 Gets or sets the type of underline applied to the font. More...
 
Color get_UnderlineColor ()
 Gets or sets the color of the underline applied to the font. More...
 
bool get_Visible () override
 
PresetTexture GetPresetTexture () override
 
virtual const TypeInfoGetType () const override
 
bool HasDmlEffect (TextDmlEffect dmlEffectType)
 Checks if particular DrawingML text effect is applied. More...
 
virtual bool Is (const TypeInfo &target) const override
 
void PresetTextured (PresetTexture presetTexture) override
 
void set_AllCaps (bool value)
 Setter for get_AllCaps. More...
 
void set_BackColor (Color value) override
 
void set_Bidi (bool value)
 Setter for get_Bidi. More...
 
void set_Bold (bool value)
 Setter for get_Bold. More...
 
void set_BoldBi (bool value)
 Setter for get_BoldBi. More...
 
void set_Color (Color value)
 Setter for get_Color. More...
 
void set_ComplexScript (bool value)
 Setter for get_ComplexScript. More...
 
void set_DoubleStrikeThrough (bool value)
 Setter for get_DoubleStrikeThrough. More...
 
void set_Emboss (bool value)
 Setter for get_Emboss. More...
 
void set_EmphasisMark (EmphasisMark value)
 Setter for get_EmphasisMark. More...
 
void set_Engrave (bool value)
 Setter for get_Engrave. More...
 
void set_FilledColor (Color value) override
 
void set_ForeColor (Color value) override
 
void set_Hidden (bool value)
 Setter for get_Hidden. More...
 
void set_HighlightColor (Color value)
 Setter for get_HighlightColor. More...
 
void set_Italic (bool value)
 Setter for get_Italic. More...
 
void set_ItalicBi (bool value)
 Setter for get_ItalicBi. More...
 
void set_Kerning (double value)
 Setter for get_Kerning. More...
 
void set_LocaleId (int32_t value)
 Setter for get_LocaleId. More...
 
void set_LocaleIdBi (int32_t value)
 Setter for get_LocaleIdBi. More...
 
void set_LocaleIdFarEast (int32_t value)
 Setter for get_LocaleIdFarEast. More...
 
void set_Name (String value)
 Setter for get_Name. More...
 
void set_NameAscii (String value)
 Setter for get_NameAscii. More...
 
void set_NameBi (String value)
 Setter for get_NameBi. More...
 
void set_NameFarEast (String value)
 Setter for get_NameFarEast. More...
 
void set_NameOther (String value)
 Setter for get_NameOther. More...
 
void set_NoProofing (bool value)
 Setter for get_NoProofing. More...
 
void set_On (bool value) override
 
void set_Opacity (double value) override
 
void set_Outline (bool value)
 Setter for get_Outline. More...
 
void set_Position (double value)
 Setter for get_Position. More...
 
void set_RotateWithObject (bool value) override
 
void set_Scaling (int32_t value)
 Setter for get_Scaling. More...
 
void set_Shadow (bool value)
 Setter for get_Shadow. More...
 
void set_Size (double value)
 Setter for get_Size. More...
 
void set_SizeBi (double value)
 Setter for get_SizeBi. More...
 
void set_SmallCaps (bool value)
 Setter for get_SmallCaps. More...
 
void set_SnapToGrid (bool value)
 Specifies whether the current font should use the document grid characters per line settings when laying out. More...
 
void set_Spacing (double value)
 Setter for get_Spacing. More...
 
void set_StrikeThrough (bool value)
 Setter for get_StrikeThrough. More...
 
void set_Style (SharedPtr< Style > value)
 Setter for get_Style. More...
 
void set_StyleIdentifier (StyleIdentifier value)
 Setter for get_StyleIdentifier. More...
 
void set_StyleName (String value)
 Setter for get_StyleName. More...
 
void set_Subscript (bool value)
 Setter for get_Subscript. More...
 
void set_Superscript (bool value)
 Setter for get_Superscript. More...
 
void set_TextEffect (TextEffect value)
 Setter for get_TextEffect. More...
 
void set_ThemeColor (ThemeColor value)
 Setter for get_ThemeColor. More...
 
void set_ThemeFont (ThemeFont value)
 Setter for get_ThemeFont. More...
 
void set_ThemeFontAscii (ThemeFont value)
 Setter for get_ThemeFontAscii. More...
 
void set_ThemeFontBi (ThemeFont value)
 Setter for get_ThemeFontBi. More...
 
void set_ThemeFontFarEast (ThemeFont value)
 Setter for get_ThemeFontFarEast. More...
 
void set_ThemeFontOther (ThemeFont value)
 Setter for get_ThemeFontOther. More...
 
void set_TintAndShade (double value)
 Setter for get_TintAndShade. More...
 
void set_Transparency (double value) override
 
void set_Underline (Underline value)
 Setter for get_Underline. More...
 
void set_UnderlineColor (Color value)
 Setter for get_UnderlineColor. More...
 
void set_Visible (bool value) override
 
void SetFill (SharedPtr< Aspose::Words::Drawing::Core::IFill > fill) override
 
void Solid () override
 

Static Public Member Functions

static const TypeInfoType ()
 

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.

Examples

Shows how to insert a hyperlink field.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);
builder->Write(u"For more information, please visit the ");
// Insert a hyperlink and emphasize it with custom formatting.
// The hyperlink will be a clickable piece of text which will take us to the location specified in the URL.
builder->get_Font()->set_Color(System::Drawing::Color::get_Blue());
builder->get_Font()->set_Underline(Underline::Single);
builder->InsertHyperlink(u"Google website", u"https://www.google.com", false);
builder->get_Font()->ClearFormatting();
builder->Writeln(u".");
// Ctrl + left clicking the link in the text in Microsoft Word will take us to the URL via a new web browser window.
doc->Save(ArtifactsDir + u"DocumentBuilder.InsertHyperlink.docx");

◆ get_AllCaps()

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

True if the font is formatted as all capital letters.

Examples

Shows how to format a run to display its contents in capitals.

auto doc = MakeObject<Document>();
auto para = System::DynamicCast<Paragraph>(doc->GetChild(NodeType::Paragraph, 0, true));
// There are two ways of getting a run to display its lowercase text in uppercase without changing the contents.
// 1 - Set the AllCaps flag to display all characters in regular capitals:
auto run = MakeObject<Run>(doc, u"all capitals");
run->get_Font()->set_AllCaps(true);
para->AppendChild(run);
para = System::DynamicCast<Paragraph>(para->get_ParentNode()->AppendChild(MakeObject<Paragraph>(doc)));
// 2 - Set the SmallCaps flag to display all characters in small capitals:
// If a character is lower case, it will appear in its upper case form
// but will have the same height as the lower case (the font's x-height).
// Characters that were in upper case originally will look the same.
run = MakeObject<Run>(doc, u"Small Capitals");
run->get_Font()->set_SmallCaps(true);
para->AppendChild(run);
doc->Save(ArtifactsDir + u"Font.Caps.docx");

◆ 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 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.

Examples

Shows how to improve readability by automatically selecting text color based on the brightness of its background.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);
// If a run's Font object does not specify text color, it will automatically
// select either black or white depending on the background color's color.
ASSERT_EQ(System::Drawing::Color::Empty.ToArgb(), builder->get_Font()->get_Color().ToArgb());
// The default color for text is black. If the color of the background is dark, black text will be difficult to see.
// To solve this problem, the AutoColor property will display this text in white.
builder->get_Font()->get_Shading()->set_BackgroundPatternColor(System::Drawing::Color::get_DarkBlue());
builder->Writeln(u"The text color automatically chosen for this run is white.");
ASSERT_EQ(System::Drawing::Color::get_White().ToArgb(),
doc->get_FirstSection()->get_Body()->get_Paragraphs()->idx_get(0)->get_Runs()->idx_get(0)->get_Font()->get_AutoColor().ToArgb());
// If we change the background to a light color, black will be a more
// suitable text color than white so that the auto color will display it in black.
builder->get_Font()->get_Shading()->set_BackgroundPatternColor(System::Drawing::Color::get_LightBlue());
builder->Writeln(u"The text color automatically chosen for this run is black.");
ASSERT_EQ(System::Drawing::Color::get_Black().ToArgb(),
doc->get_FirstSection()->get_Body()->get_Paragraphs()->idx_get(1)->get_Runs()->idx_get(0)->get_Font()->get_AutoColor().ToArgb());
doc->Save(ArtifactsDir + u"Font.SetFontAutoColor.docx");

◆ get_BackColor()

System::Drawing::Color Aspose::Words::Font::get_BackColor ( )
override

◆ 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 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".

Examples

Shows how to define separate sets of font settings for right-to-left, and right-to-left text.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);
// Define a set of font settings for left-to-right text.
builder->get_Font()->set_Name(u"Courier New");
builder->get_Font()->set_Size(16);
builder->get_Font()->set_Italic(false);
builder->get_Font()->set_Bold(false);
builder->get_Font()->set_LocaleId(MakeObject<System::Globalization::CultureInfo>(u"en-US", false)->get_LCID());
// Define another set of font settings for right-to-left text.
builder->get_Font()->set_NameBi(u"Andalus");
builder->get_Font()->set_SizeBi(24);
builder->get_Font()->set_ItalicBi(true);
builder->get_Font()->set_BoldBi(true);
builder->get_Font()->set_LocaleIdBi(MakeObject<System::Globalization::CultureInfo>(u"ar-AR", false)->get_LCID());
// We can use the Bidi flag to indicate whether the text we are about to add
// with the document builder is right-to-left. When we add text with this flag set to true,
// it will be formatted using the right-to-left set of font settings.
builder->get_Font()->set_Bidi(true);
builder->Write(u"مرحبًا");
// Set the flag to false, and then add left-to-right text.
// The document builder will format these using the left-to-right set of font settings.
builder->get_Font()->set_Bidi(false);
builder->Write(u" Hello world!");
doc->Save(ArtifactsDir + u"Font.Bidi.docx");

◆ get_Bold()

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

True if the font is formatted as bold.

Examples

Shows how to insert formatted text using DocumentBuilder.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);
// Specify font formatting, then add text.
SharedPtr<Aspose::Words::Font> font = builder->get_Font();
font->set_Size(16);
font->set_Bold(true);
font->set_Name(u"Courier New");
font->set_Underline(Underline::Dash);
builder->Write(u"Hello world!");

◆ get_BoldBi()

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

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

Examples

Shows how to define separate sets of font settings for right-to-left, and right-to-left text.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);
// Define a set of font settings for left-to-right text.
builder->get_Font()->set_Name(u"Courier New");
builder->get_Font()->set_Size(16);
builder->get_Font()->set_Italic(false);
builder->get_Font()->set_Bold(false);
builder->get_Font()->set_LocaleId(MakeObject<System::Globalization::CultureInfo>(u"en-US", false)->get_LCID());
// Define another set of font settings for right-to-left text.
builder->get_Font()->set_NameBi(u"Andalus");
builder->get_Font()->set_SizeBi(24);
builder->get_Font()->set_ItalicBi(true);
builder->get_Font()->set_BoldBi(true);
builder->get_Font()->set_LocaleIdBi(MakeObject<System::Globalization::CultureInfo>(u"ar-AR", false)->get_LCID());
// We can use the Bidi flag to indicate whether the text we are about to add
// with the document builder is right-to-left. When we add text with this flag set to true,
// it will be formatted using the right-to-left set of font settings.
builder->get_Font()->set_Bidi(true);
builder->Write(u"مرحبًا");
// Set the flag to false, and then add left-to-right text.
// The document builder will format these using the left-to-right set of font settings.
builder->get_Font()->set_Bidi(false);
builder->Write(u" Hello world!");
doc->Save(ArtifactsDir + u"Font.Bidi.docx");

◆ get_Border()

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

Returns a Border object that specifies border for the font.

Examples

Shows how to insert a string surrounded by a border into a document.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);
builder->get_Font()->get_Border()->set_Color(System::Drawing::Color::get_Green());
builder->get_Font()->get_Border()->set_LineWidth(2.5);
builder->get_Font()->get_Border()->set_LineStyle(LineStyle::DashDotStroker);
builder->Write(u"Text surrounded by green border.");
doc->Save(ArtifactsDir + u"Border.FontBorder.docx");

◆ get_Color()

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

Gets or sets the color of the font.

Examples

Shows how to insert formatted text using DocumentBuilder.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);
// Specify font formatting, then add text.
SharedPtr<Aspose::Words::Font> font = builder->get_Font();
font->set_Size(16);
font->set_Bold(true);
font->set_Name(u"Courier New");
font->set_Underline(Underline::Dash);
builder->Write(u"Hello world!");

Shows how to insert a hyperlink field.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);
builder->Write(u"For more information, please visit the ");
// Insert a hyperlink and emphasize it with custom formatting.
// The hyperlink will be a clickable piece of text which will take us to the location specified in the URL.
builder->get_Font()->set_Color(System::Drawing::Color::get_Blue());
builder->get_Font()->set_Underline(Underline::Single);
builder->InsertHyperlink(u"Google website", u"https://www.google.com", false);
builder->get_Font()->ClearFormatting();
builder->Writeln(u".");
// Ctrl + left clicking the link in the text in Microsoft Word will take us to the URL via a new web browser window.
doc->Save(ArtifactsDir + u"DocumentBuilder.InsertHyperlink.docx");

◆ 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.

Examples

Shows how to add text that is always treated as complex script.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);
builder->get_Font()->set_ComplexScript(true);
builder->Writeln(u"Text treated as complex script.");
doc->Save(ArtifactsDir + u"Font.ComplexScript.docx");

◆ get_DoubleStrikeThrough()

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

True if the font is formatted as double strikethrough text.

Examples

Shows how to add a line strikethrough to text.

auto doc = MakeObject<Document>();
auto para = System::DynamicCast<Paragraph>(doc->GetChild(NodeType::Paragraph, 0, true));
auto run = MakeObject<Run>(doc, u"Text with a single-line strikethrough.");
run->get_Font()->set_StrikeThrough(true);
para->AppendChild(run);
para = System::DynamicCast<Paragraph>(para->get_ParentNode()->AppendChild(MakeObject<Paragraph>(doc)));
run = MakeObject<Run>(doc, u"Text with a double-line strikethrough.");
run->get_Font()->set_DoubleStrikeThrough(true);
para->AppendChild(run);
doc->Save(ArtifactsDir + u"Font.StrikeThrough.docx");

◆ get_Emboss()

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

True if the font is formatted as embossed.

Examples

Shows how to apply engraving/embossing effects to text.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);
builder->get_Font()->set_Size(36);
builder->get_Font()->set_Color(System::Drawing::Color::get_LightBlue());
// Below are two ways of using shadows to apply a 3D-like effect to the text.
// 1 - Engrave text to make it look like the letters are sunken into the page:
builder->get_Font()->set_Engrave(true);
builder->Writeln(u"This text is engraved.");
// 2 - Emboss text to make it look like the letters pop out of the page:
builder->get_Font()->set_Engrave(false);
builder->get_Font()->set_Emboss(true);
builder->Writeln(u"This text is embossed.");
doc->Save(ArtifactsDir + u"Font.EngraveEmboss.docx");

◆ get_EmphasisMark()

Aspose::Words::EmphasisMark Aspose::Words::Font::get_EmphasisMark ( )

Gets or sets the emphasis mark applied to this formatting.

Examples

Shows how to add additional character rendered above/below the glyph-character.

auto builder = MakeObject<DocumentBuilder>();
// Possible types of emphasis mark:
// https://apireference.aspose.com/words/net/aspose.words/emphasismark
builder->get_Font()->set_EmphasisMark(emphasisMark);
builder->Write(u"Emphasis text");
builder->Writeln();
builder->get_Font()->ClearFormatting();
builder->Write(u"Simple text");
builder->get_Document()->Save(ArtifactsDir + u"Fonts.SetEmphasisMark.docx");

◆ get_Engrave()

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

True if the font is formatted as engraved.

Examples

Shows how to apply engraving/embossing effects to text.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);
builder->get_Font()->set_Size(36);
builder->get_Font()->set_Color(System::Drawing::Color::get_LightBlue());
// Below are two ways of using shadows to apply a 3D-like effect to the text.
// 1 - Engrave text to make it look like the letters are sunken into the page:
builder->get_Font()->set_Engrave(true);
builder->Writeln(u"This text is engraved.");
// 2 - Emboss text to make it look like the letters pop out of the page:
builder->get_Font()->set_Engrave(false);
builder->get_Font()->set_Emboss(true);
builder->Writeln(u"This text is embossed.");
doc->Save(ArtifactsDir + u"Font.EngraveEmboss.docx");

◆ get_Fill()

System::SharedPtr<Aspose::Words::Drawing::Fill> Aspose::Words::Font::get_Fill ( )

Gets fill formatting for the Font.

◆ get_FilledColor()

System::Drawing::Color Aspose::Words::Font::get_FilledColor ( )
override

◆ get_FillType()

Aspose::Words::Drawing::Core::FillTypeCore Aspose::Words::Font::get_FillType ( )
override

◆ get_ForeColor()

System::Drawing::Color Aspose::Words::Font::get_ForeColor ( )
override

◆ get_Hidden()

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

True if the font is formatted as hidden text.

Examples

Shows how to create a run of hidden text.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);
// With the Hidden flag set to true, any text that we create using this Font object will be invisible in the document.
// We will not see or highlight hidden text unless we enable the "Hidden text" option
// found in Microsoft Word via "File" -> "Options" -> "Display". The text will still be there,
// and we will be able to access this text programmatically.
// It is not advised to use this method to hide sensitive information.
builder->get_Font()->set_Hidden(true);
builder->get_Font()->set_Size(36);
builder->Writeln(u"This text will not be visible in the document.");
doc->Save(ArtifactsDir + u"Font.Hidden.docx");

Shows how to use a DocumentVisitor implementation to remove all hidden content from a document.

void RemoveHiddenContentFromDocument()
{
auto doc = MakeObject<Document>(MyDir + u"Hidden content.docx");
auto hiddenContentRemover = MakeObject<ExFont::RemoveHiddenContentVisitor>();
// Below are three types of fields which can accept a document visitor,
// which will allow it to visit the accepting node, and then traverse its child nodes in a depth-first manner.
// 1 - Paragraph node:
auto para = System::DynamicCast<Paragraph>(doc->GetChild(NodeType::Paragraph, 4, true));
para->Accept(hiddenContentRemover);
// 2 - Table node:
SharedPtr<Table> table = doc->get_FirstSection()->get_Body()->get_Tables()->idx_get(0);
table->Accept(hiddenContentRemover);
// 3 - Document node:
doc->Accept(hiddenContentRemover);
doc->Save(ArtifactsDir + u"Font.RemoveHiddenContentFromDocument.docx");
}
class RemoveHiddenContentVisitor : public DocumentVisitor
{
public:
VisitorAction VisitFieldStart(SharedPtr<FieldStart> fieldStart) override
{
if (fieldStart->get_Font()->get_Hidden())
{
fieldStart->Remove();
}
}
VisitorAction VisitFieldEnd(SharedPtr<FieldEnd> fieldEnd) override
{
if (fieldEnd->get_Font()->get_Hidden())
{
fieldEnd->Remove();
}
}
VisitorAction VisitFieldSeparator(SharedPtr<FieldSeparator> fieldSeparator) override
{
if (fieldSeparator->get_Font()->get_Hidden())
{
fieldSeparator->Remove();
}
}
VisitorAction VisitRun(SharedPtr<Run> run) override
{
if (run->get_Font()->get_Hidden())
{
run->Remove();
}
}
VisitorAction VisitParagraphStart(SharedPtr<Paragraph> paragraph) override
{
if (paragraph->get_ParagraphBreakFont()->get_Hidden())
{
paragraph->Remove();
}
}
VisitorAction VisitFormField(SharedPtr<FormField> formField) override
{
if (formField->get_Font()->get_Hidden())
{
formField->Remove();
}
}
VisitorAction VisitGroupShapeStart(SharedPtr<GroupShape> groupShape) override
{
if (groupShape->get_Font()->get_Hidden())
{
groupShape->Remove();
}
}
VisitorAction VisitShapeStart(SharedPtr<Shape> shape) override
{
if (shape->get_Font()->get_Hidden())
{
shape->Remove();
}
}
VisitorAction VisitCommentStart(SharedPtr<Comment> comment) override
{
if (comment->get_Font()->get_Hidden())
{
comment->Remove();
}
}
VisitorAction VisitFootnoteStart(SharedPtr<Footnote> footnote) override
{
if (footnote->get_Font()->get_Hidden())
{
footnote->Remove();
}
}
VisitorAction VisitSpecialChar(SharedPtr<SpecialChar> specialChar) override
{
if (specialChar->get_Font()->get_Hidden())
{
specialChar->Remove();
}
}
VisitorAction VisitTableEnd(SharedPtr<Table> table) override
{
// The content inside table cells may have the hidden content flag, but the tables themselves cannot.
// If this table had nothing but hidden content, this visitor would have removed all of it,
// and there would be no child nodes left.
// Thus, we can also treat the table itself as hidden content and remove it.
// Tables which are empty but do not have hidden content will have cells with empty paragraphs inside,
// which this visitor will not remove.
if (!table->get_HasChildNodes())
{
table->Remove();
}
}
VisitorAction VisitCellEnd(SharedPtr<Cell> cell) override
{
if (!cell->get_HasChildNodes() && cell->get_ParentNode() != nullptr)
{
cell->Remove();
}
}
VisitorAction VisitRowEnd(SharedPtr<Row> row) override
{
if (!row->get_HasChildNodes() && row->get_ParentNode() != nullptr)
{
row->Remove();
}
}
};

◆ get_HighlightColor()

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

Gets or sets the highlight (marker) color.

Examples

Shows how to format a run of text using its font property.

auto doc = MakeObject<Document>();
auto run = MakeObject<Run>(doc, u"Hello world!");
SharedPtr<Aspose::Words::Font> font = run->get_Font();
font->set_Name(u"Courier New");
font->set_Size(36);
font->set_HighlightColor(System::Drawing::Color::get_Yellow());
doc->get_FirstSection()->get_Body()->get_FirstParagraph()->AppendChild(run);
doc->Save(ArtifactsDir + u"Font.CreateFormattedRun.docx");

◆ get_ImageBytes()

System::ArrayPtr<uint8_t> Aspose::Words::Font::get_ImageBytes ( )
override

◆ get_Italic()

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

True if the font is formatted as italic.

Examples

Shows how to write italicized text using a document builder.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);
builder->get_Font()->set_Size(36);
builder->get_Font()->set_Italic(true);
builder->Writeln(u"Hello world!");
doc->Save(ArtifactsDir + u"Font.Italic.docx");

◆ get_ItalicBi()

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

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

Examples

Shows how to define separate sets of font settings for right-to-left, and right-to-left text.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);
// Define a set of font settings for left-to-right text.
builder->get_Font()->set_Name(u"Courier New");
builder->get_Font()->set_Size(16);
builder->get_Font()->set_Italic(false);
builder->get_Font()->set_Bold(false);
builder->get_Font()->set_LocaleId(MakeObject<System::Globalization::CultureInfo>(u"en-US", false)->get_LCID());
// Define another set of font settings for right-to-left text.
builder->get_Font()->set_NameBi(u"Andalus");
builder->get_Font()->set_SizeBi(24);
builder->get_Font()->set_ItalicBi(true);
builder->get_Font()->set_BoldBi(true);
builder->get_Font()->set_LocaleIdBi(MakeObject<System::Globalization::CultureInfo>(u"ar-AR", false)->get_LCID());
// We can use the Bidi flag to indicate whether the text we are about to add
// with the document builder is right-to-left. When we add text with this flag set to true,
// it will be formatted using the right-to-left set of font settings.
builder->get_Font()->set_Bidi(true);
builder->Write(u"مرحبًا");
// Set the flag to false, and then add left-to-right text.
// The document builder will format these using the left-to-right set of font settings.
builder->get_Font()->set_Bidi(false);
builder->Write(u" Hello world!");
doc->Save(ArtifactsDir + u"Font.Bidi.docx");

◆ get_Kerning()

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

Gets or sets the font size at which kerning starts.

Examples

Shows how to specify the font size at which kerning begins to take effect.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);
builder->get_Font()->set_Name(u"Arial Black");
// Set the builder's font size, and minimum size at which kerning will take effect.
// The font size falls below the kerning threshold, so the run bellow will not have kerning.
builder->get_Font()->set_Size(18);
builder->get_Font()->set_Kerning(24);
builder->Writeln(u"TALLY. (Kerning not applied)");
// Set the kerning threshold so that the builder's current font size is above it.
// Any text we add from this point will have kerning applied. The spaces between characters
// will be adjusted, normally resulting in a slightly more aesthetically pleasing text run.
builder->get_Font()->set_Kerning(12);
builder->Writeln(u"TALLY. (Kerning applied)");
doc->Save(ArtifactsDir + u"Font.Kerning.docx");

◆ get_LineSpacing()

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

Returns line spacing of this font (in points).

Examples

Shows how to get a font's line spacing, in points.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);
// Set different fonts for the DocumentBuilder and verify their line spacing.
builder->get_Font()->set_Name(u"Calibri");
ASPOSE_ASSERT_EQ(14.6484375, builder->get_Font()->get_LineSpacing());
builder->get_Font()->set_Name(u"Times New Roman");
ASPOSE_ASSERT_EQ(13.798828125, builder->get_Font()->get_LineSpacing());

◆ get_LocaleId()

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

Gets or sets the locale identifier (language) of the formatted characters.

Examples

Shows how to set the locale of the text that we are adding with a document builder.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);
// If we set the font's locale to English and insert some Russian text,
// the English locale spell checker will not recognize the text and detect it as a spelling error.
builder->get_Font()->set_LocaleId(MakeObject<System::Globalization::CultureInfo>(u"en-US", false)->get_LCID());
builder->Writeln(u"Привет!");
// Set a matching locale for the text that we are about to add to apply the appropriate spell checker.
builder->get_Font()->set_LocaleId(MakeObject<System::Globalization::CultureInfo>(u"ru-RU", false)->get_LCID());
builder->Writeln(u"Привет!");
doc->Save(ArtifactsDir + u"Font.LocaleId.docx");

◆ get_LocaleIdBi()

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

Gets or sets the locale identifier (language) of the formatted right-to-left characters.

Examples

Shows how to define separate sets of font settings for right-to-left, and right-to-left text.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);
// Define a set of font settings for left-to-right text.
builder->get_Font()->set_Name(u"Courier New");
builder->get_Font()->set_Size(16);
builder->get_Font()->set_Italic(false);
builder->get_Font()->set_Bold(false);
builder->get_Font()->set_LocaleId(MakeObject<System::Globalization::CultureInfo>(u"en-US", false)->get_LCID());
// Define another set of font settings for right-to-left text.
builder->get_Font()->set_NameBi(u"Andalus");
builder->get_Font()->set_SizeBi(24);
builder->get_Font()->set_ItalicBi(true);
builder->get_Font()->set_BoldBi(true);
builder->get_Font()->set_LocaleIdBi(MakeObject<System::Globalization::CultureInfo>(u"ar-AR", false)->get_LCID());
// We can use the Bidi flag to indicate whether the text we are about to add
// with the document builder is right-to-left. When we add text with this flag set to true,
// it will be formatted using the right-to-left set of font settings.
builder->get_Font()->set_Bidi(true);
builder->Write(u"مرحبًا");
// Set the flag to false, and then add left-to-right text.
// The document builder will format these using the left-to-right set of font settings.
builder->get_Font()->set_Bidi(false);
builder->Write(u" Hello world!");
doc->Save(ArtifactsDir + u"Font.Bidi.docx");

◆ get_LocaleIdFarEast()

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

Gets or sets the locale identifier (language) of the formatted Asian characters.

Examples

Shows how to insert and format text in a Far East language.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);
// Specify font settings that the document builder will apply to any text that it inserts.
builder->get_Font()->set_Name(u"Courier New");
builder->get_Font()->set_LocaleId(MakeObject<System::Globalization::CultureInfo>(u"en-US", false)->get_LCID());
// Name "FarEast" equivalents for our font and locale.
// If the builder inserts Asian characters with this Font configuration, then each run that contains
// these characters will display them using the "FarEast" font/locale instead of the default.
// This could be useful when a western font does not have ideal representations for Asian characters.
builder->get_Font()->set_NameFarEast(u"SimSun");
builder->get_Font()->set_LocaleIdFarEast(MakeObject<System::Globalization::CultureInfo>(u"zh-CN", false)->get_LCID());
// This text will be displayed in the default font/locale.
builder->Writeln(u"Hello world!");
// Since these are Asian characters, this run will apply our "FarEast" font/locale equivalents.
builder->Writeln(u"你好世界");
doc->Save(ArtifactsDir + u"Font.FarEast.docx");

◆ get_Name()

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

Gets or sets the name of the font.

When getting, returns NameAscii.

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

Examples

Shows how to insert formatted text using DocumentBuilder.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);
// Specify font formatting, then add text.
SharedPtr<Aspose::Words::Font> font = builder->get_Font();
font->set_Size(16);
font->set_Bold(true);
font->set_Name(u"Courier New");
font->set_Underline(Underline::Dash);
builder->Write(u"Hello world!");

Shows how to format a run of text using its font property.

auto doc = MakeObject<Document>();
auto run = MakeObject<Run>(doc, u"Hello world!");
SharedPtr<Aspose::Words::Font> font = run->get_Font();
font->set_Name(u"Courier New");
font->set_Size(36);
font->set_HighlightColor(System::Drawing::Color::get_Yellow());
doc->get_FirstSection()->get_Body()->get_FirstParagraph()->AppendChild(run);
doc->Save(ArtifactsDir + u"Font.CreateFormattedRun.docx");

◆ 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
Examples

Shows how Microsoft Word can combine two different fonts in one run.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);
// Suppose a run that we use the builder to insert while using this font configuration
// contains characters within the ASCII characters' range. In that case,
// it will display those characters using this font.
builder->get_Font()->set_NameAscii(u"Calibri");
// With no other font specified, the builder will also apply this font to all characters that it inserts.
ASSERT_EQ(u"Calibri", builder->get_Font()->get_Name());
// Specify a font to use for all characters outside of the ASCII range.
// Ideally, this font should have a glyph for each required non-ASCII character code.
builder->get_Font()->set_NameOther(u"Courier New");
// Insert a run with one word consisting of ASCII characters, and one word with all characters outside that range.
// Each character will be displayed using either of the fonts, depending on.
builder->Writeln(u"Hello, Привет");
doc->Save(ArtifactsDir + u"Font.NameAscii.docx");

◆ 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
Examples

Shows how to define separate sets of font settings for right-to-left, and right-to-left text.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);
// Define a set of font settings for left-to-right text.
builder->get_Font()->set_Name(u"Courier New");
builder->get_Font()->set_Size(16);
builder->get_Font()->set_Italic(false);
builder->get_Font()->set_Bold(false);
builder->get_Font()->set_LocaleId(MakeObject<System::Globalization::CultureInfo>(u"en-US", false)->get_LCID());
// Define another set of font settings for right-to-left text.
builder->get_Font()->set_NameBi(u"Andalus");
builder->get_Font()->set_SizeBi(24);
builder->get_Font()->set_ItalicBi(true);
builder->get_Font()->set_BoldBi(true);
builder->get_Font()->set_LocaleIdBi(MakeObject<System::Globalization::CultureInfo>(u"ar-AR", false)->get_LCID());
// We can use the Bidi flag to indicate whether the text we are about to add
// with the document builder is right-to-left. When we add text with this flag set to true,
// it will be formatted using the right-to-left set of font settings.
builder->get_Font()->set_Bidi(true);
builder->Write(u"مرحبًا");
// Set the flag to false, and then add left-to-right text.
// The document builder will format these using the left-to-right set of font settings.
builder->get_Font()->set_Bidi(false);
builder->Write(u" Hello world!");
doc->Save(ArtifactsDir + u"Font.Bidi.docx");

◆ get_NameFarEast()

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

Returns or sets an East Asian font name.

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

Shows how to insert and format text in a Far East language.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);
// Specify font settings that the document builder will apply to any text that it inserts.
builder->get_Font()->set_Name(u"Courier New");
builder->get_Font()->set_LocaleId(MakeObject<System::Globalization::CultureInfo>(u"en-US", false)->get_LCID());
// Name "FarEast" equivalents for our font and locale.
// If the builder inserts Asian characters with this Font configuration, then each run that contains
// these characters will display them using the "FarEast" font/locale instead of the default.
// This could be useful when a western font does not have ideal representations for Asian characters.
builder->get_Font()->set_NameFarEast(u"SimSun");
builder->get_Font()->set_LocaleIdFarEast(MakeObject<System::Globalization::CultureInfo>(u"zh-CN", false)->get_LCID());
// This text will be displayed in the default font/locale.
builder->Writeln(u"Hello world!");
// Since these are Asian characters, this run will apply our "FarEast" font/locale equivalents.
builder->Writeln(u"你好世界");
doc->Save(ArtifactsDir + u"Font.FarEast.docx");

◆ 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
Examples

Shows how Microsoft Word can combine two different fonts in one run.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);
// Suppose a run that we use the builder to insert while using this font configuration
// contains characters within the ASCII characters' range. In that case,
// it will display those characters using this font.
builder->get_Font()->set_NameAscii(u"Calibri");
// With no other font specified, the builder will also apply this font to all characters that it inserts.
ASSERT_EQ(u"Calibri", builder->get_Font()->get_Name());
// Specify a font to use for all characters outside of the ASCII range.
// Ideally, this font should have a glyph for each required non-ASCII character code.
builder->get_Font()->set_NameOther(u"Courier New");
// Insert a run with one word consisting of ASCII characters, and one word with all characters outside that range.
// Each character will be displayed using either of the fonts, depending on.
builder->Writeln(u"Hello, Привет");
doc->Save(ArtifactsDir + u"Font.NameAscii.docx");

◆ get_NoProofing()

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

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

Examples

Shows how to prevent text from being spell checked by Microsoft Word.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);
// Normally, Microsoft Word emphasizes spelling errors with a jagged red underline.
// We can un-set the "NoProofing" flag to create a portion of text that
// bypasses the spell checker while completely disabling it.
builder->get_Font()->set_NoProofing(true);
builder->Writeln(u"Proofing has been disabled, so these spelking errrs will not display red lines underneath.");
doc->Save(ArtifactsDir + u"Font.NoProofing.docx");

◆ get_On()

bool Aspose::Words::Font::get_On ( )
override

◆ get_Opacity()

double Aspose::Words::Font::get_Opacity ( )
override

◆ get_Outline()

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

True if the font is formatted as outline.

Examples

Shows how to create a run of text formatted as outline.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);
// Set the Outline flag to change the text's fill color to white and
// leave a thin outline around each character in the original color of the text.
builder->get_Font()->set_Outline(true);
builder->get_Font()->set_Color(System::Drawing::Color::get_Blue());
builder->get_Font()->set_Size(36);
builder->Writeln(u"This text has an outline.");
doc->Save(ArtifactsDir + u"Font.Outline.docx");

◆ 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.

Examples

Shows how to format text to offset its position.

auto doc = MakeObject<Document>();
auto para = System::DynamicCast<Paragraph>(doc->GetChild(NodeType::Paragraph, 0, true));
// Raise this run of text 5 points above the baseline.
auto run = MakeObject<Run>(doc, u"Raised text. ");
run->get_Font()->set_Position(5);
para->AppendChild(run);
// Lower this run of text 10 points below the baseline.
run = MakeObject<Run>(doc, u"Lowered text. ");
run->get_Font()->set_Position(-10);
para->AppendChild(run);
// Add a run of normal text.
run = MakeObject<Run>(doc, u"Text in its default position. ");
para->AppendChild(run);
// Add a run of text that appears as subscript.
run = MakeObject<Run>(doc, u"Subscript. ");
run->get_Font()->set_Subscript(true);
para->AppendChild(run);
// Add a run of text that appears as superscript.
run = MakeObject<Run>(doc, u"Superscript.");
run->get_Font()->set_Superscript(true);
para->AppendChild(run);
doc->Save(ArtifactsDir + u"Font.PositionSubscript.docx");

◆ get_RotateWithObject()

bool Aspose::Words::Font::get_RotateWithObject ( )
override

◆ get_Scaling()

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

Gets or sets character width scaling in percent.

Examples

Shows how to set horizontal scaling and spacing for characters.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);
// Add run of text and increase character width to 150%.
builder->get_Font()->set_Scaling(150);
builder->Writeln(u"Wide characters");
// Add run of text and add 1pt of extra horizontal spacing between each character.
builder->get_Font()->set_Spacing(1);
builder->Writeln(u"Expanded by 1pt");
// Add run of text and bring characters closer together by 1pt.
builder->get_Font()->set_Spacing(-1);
builder->Writeln(u"Condensed by 1pt");
doc->Save(ArtifactsDir + u"Font.ScalingSpacing.docx");

◆ 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.

Examples

Shows how to apply shading to text created by a document builder.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);
builder->get_Font()->set_Color(System::Drawing::Color::get_White());
// One way to make the text created using our white font color visible
// is to apply a background shading effect.
SharedPtr<Shading> shading = builder->get_Font()->get_Shading();
shading->set_Texture(TextureIndex::TextureDiagonalUp);
shading->set_BackgroundPatternColor(System::Drawing::Color::get_OrangeRed());
shading->set_ForegroundPatternColor(System::Drawing::Color::get_DarkBlue());
builder->Writeln(u"White text on an orange background with a two-tone texture.");
doc->Save(ArtifactsDir + u"Font.Shading.docx");

◆ get_Shadow()

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

True if the font is formatted as shadowed.

Examples

Shows how to create a run of text formatted with a shadow.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);
// Set the Shadow flag to apply an offset shadow effect,
// making it look like the letters are floating above the page.
builder->get_Font()->set_Shadow(true);
builder->get_Font()->set_Size(36);
builder->Writeln(u"This text has a shadow.");
doc->Save(ArtifactsDir + u"Font.Shadow.docx");

◆ get_Size()

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

Gets or sets the font size in points.

Examples

Shows how to insert formatted text using DocumentBuilder.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);
// Specify font formatting, then add text.
SharedPtr<Aspose::Words::Font> font = builder->get_Font();
font->set_Size(16);
font->set_Bold(true);
font->set_Name(u"Courier New");
font->set_Underline(Underline::Dash);
builder->Write(u"Hello world!");

Shows how to format a run of text using its font property.

auto doc = MakeObject<Document>();
auto run = MakeObject<Run>(doc, u"Hello world!");
SharedPtr<Aspose::Words::Font> font = run->get_Font();
font->set_Name(u"Courier New");
font->set_Size(36);
font->set_HighlightColor(System::Drawing::Color::get_Yellow());
doc->get_FirstSection()->get_Body()->get_FirstParagraph()->AppendChild(run);
doc->Save(ArtifactsDir + u"Font.CreateFormattedRun.docx");

◆ get_SizeBi()

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

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

Examples

Shows how to define separate sets of font settings for right-to-left, and right-to-left text.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);
// Define a set of font settings for left-to-right text.
builder->get_Font()->set_Name(u"Courier New");
builder->get_Font()->set_Size(16);
builder->get_Font()->set_Italic(false);
builder->get_Font()->set_Bold(false);
builder->get_Font()->set_LocaleId(MakeObject<System::Globalization::CultureInfo>(u"en-US", false)->get_LCID());
// Define another set of font settings for right-to-left text.
builder->get_Font()->set_NameBi(u"Andalus");
builder->get_Font()->set_SizeBi(24);
builder->get_Font()->set_ItalicBi(true);
builder->get_Font()->set_BoldBi(true);
builder->get_Font()->set_LocaleIdBi(MakeObject<System::Globalization::CultureInfo>(u"ar-AR", false)->get_LCID());
// We can use the Bidi flag to indicate whether the text we are about to add
// with the document builder is right-to-left. When we add text with this flag set to true,
// it will be formatted using the right-to-left set of font settings.
builder->get_Font()->set_Bidi(true);
builder->Write(u"مرحبًا");
// Set the flag to false, and then add left-to-right text.
// The document builder will format these using the left-to-right set of font settings.
builder->get_Font()->set_Bidi(false);
builder->Write(u" Hello world!");
doc->Save(ArtifactsDir + u"Font.Bidi.docx");

◆ get_SmallCaps()

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

True if the font is formatted as small capital letters.

Examples

Shows how to format a run to display its contents in capitals.

auto doc = MakeObject<Document>();
auto para = System::DynamicCast<Paragraph>(doc->GetChild(NodeType::Paragraph, 0, true));
// There are two ways of getting a run to display its lowercase text in uppercase without changing the contents.
// 1 - Set the AllCaps flag to display all characters in regular capitals:
auto run = MakeObject<Run>(doc, u"all capitals");
run->get_Font()->set_AllCaps(true);
para->AppendChild(run);
para = System::DynamicCast<Paragraph>(para->get_ParentNode()->AppendChild(MakeObject<Paragraph>(doc)));
// 2 - Set the SmallCaps flag to display all characters in small capitals:
// If a character is lower case, it will appear in its upper case form
// but will have the same height as the lower case (the font's x-height).
// Characters that were in upper case originally will look the same.
run = MakeObject<Run>(doc, u"Small Capitals");
run->get_Font()->set_SmallCaps(true);
para->AppendChild(run);
doc->Save(ArtifactsDir + u"Font.Caps.docx");

◆ get_SnapToGrid()

bool Aspose::Words::Font::get_SnapToGrid ( )

Specifies whether the current font should use the document grid characters per line settings when laying out.

◆ get_Spacing()

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

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

Examples

Shows how to set horizontal scaling and spacing for characters.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);
// Add run of text and increase character width to 150%.
builder->get_Font()->set_Scaling(150);
builder->Writeln(u"Wide characters");
// Add run of text and add 1pt of extra horizontal spacing between each character.
builder->get_Font()->set_Spacing(1);
builder->Writeln(u"Expanded by 1pt");
// Add run of text and bring characters closer together by 1pt.
builder->get_Font()->set_Spacing(-1);
builder->Writeln(u"Condensed by 1pt");
doc->Save(ArtifactsDir + u"Font.ScalingSpacing.docx");

◆ get_StrikeThrough()

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

True if the font is formatted as strikethrough text.

Examples

Shows how to add a line strikethrough to text.

auto doc = MakeObject<Document>();
auto para = System::DynamicCast<Paragraph>(doc->GetChild(NodeType::Paragraph, 0, true));
auto run = MakeObject<Run>(doc, u"Text with a single-line strikethrough.");
run->get_Font()->set_StrikeThrough(true);
para->AppendChild(run);
para = System::DynamicCast<Paragraph>(para->get_ParentNode()->AppendChild(MakeObject<Paragraph>(doc)));
run = MakeObject<Run>(doc, u"Text with a double-line strikethrough.");
run->get_Font()->set_DoubleStrikeThrough(true);
para->AppendChild(run);
doc->Save(ArtifactsDir + u"Font.StrikeThrough.docx");

◆ get_Style()

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

Gets or sets the character style applied to this formatting.

Examples

Applies a double underline to all runs in a document that are formatted with custom character styles.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);
// Insert a custom style and apply it to text created using a document builder.
SharedPtr<Style> style = doc->get_Styles()->Add(StyleType::Character, u"MyStyle");
style->get_Font()->set_Color(System::Drawing::Color::get_Red());
style->get_Font()->set_Name(u"Courier New");
builder->get_Font()->set_StyleName(u"MyStyle");
builder->Write(u"This text is in a custom style.");
// Iterate over every run and add a double underline to every custom style.
for (const auto& run : System::IterateOver(doc->GetChildNodes(NodeType::Run, true)->LINQ_OfType<SharedPtr<Run>>()))
{
SharedPtr<Style> charStyle = run->get_Font()->get_Style();
if (!charStyle->get_BuiltIn())
{
run->get_Font()->set_Underline(Underline::Double);
}
}
doc->Save(ArtifactsDir + u"Font.Style.docx");

◆ 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.

Examples

Shows how to change the style of existing text.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);
// Below are two ways of referencing styles.
// 1 - Using the style name:
builder->get_Font()->set_StyleName(u"Emphasis");
builder->Writeln(u"Text originally in \"Emphasis\" style");
// 2 - Using a built-in style identifier:
builder->get_Font()->set_StyleIdentifier(StyleIdentifier::IntenseEmphasis);
builder->Writeln(u"Text originally in \"Intense Emphasis\" style");
// Convert all uses of one style to another,
// using the above methods to reference old and new styles.
for (const auto& run : System::IterateOver(doc->GetChildNodes(NodeType::Run, true)->LINQ_OfType<SharedPtr<Run>>()))
{
if (run->get_Font()->get_StyleName() == u"Emphasis")
{
run->get_Font()->set_StyleName(u"Strong");
}
if (run->get_Font()->get_StyleIdentifier() == StyleIdentifier::IntenseEmphasis)
{
run->get_Font()->set_StyleIdentifier(StyleIdentifier::Strong);
}
}
doc->Save(ArtifactsDir + u"Font.ChangeStyle.docx");

◆ get_StyleName()

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

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

Examples

Shows how to change the style of existing text.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);
// Below are two ways of referencing styles.
// 1 - Using the style name:
builder->get_Font()->set_StyleName(u"Emphasis");
builder->Writeln(u"Text originally in \"Emphasis\" style");
// 2 - Using a built-in style identifier:
builder->get_Font()->set_StyleIdentifier(StyleIdentifier::IntenseEmphasis);
builder->Writeln(u"Text originally in \"Intense Emphasis\" style");
// Convert all uses of one style to another,
// using the above methods to reference old and new styles.
for (const auto& run : System::IterateOver(doc->GetChildNodes(NodeType::Run, true)->LINQ_OfType<SharedPtr<Run>>()))
{
if (run->get_Font()->get_StyleName() == u"Emphasis")
{
run->get_Font()->set_StyleName(u"Strong");
}
if (run->get_Font()->get_StyleIdentifier() == StyleIdentifier::IntenseEmphasis)
{
run->get_Font()->set_StyleIdentifier(StyleIdentifier::Strong);
}
}
doc->Save(ArtifactsDir + u"Font.ChangeStyle.docx");

◆ get_Subscript()

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

True if the font is formatted as subscript.

Examples

Shows how to format text to offset its position.

auto doc = MakeObject<Document>();
auto para = System::DynamicCast<Paragraph>(doc->GetChild(NodeType::Paragraph, 0, true));
// Raise this run of text 5 points above the baseline.
auto run = MakeObject<Run>(doc, u"Raised text. ");
run->get_Font()->set_Position(5);
para->AppendChild(run);
// Lower this run of text 10 points below the baseline.
run = MakeObject<Run>(doc, u"Lowered text. ");
run->get_Font()->set_Position(-10);
para->AppendChild(run);
// Add a run of normal text.
run = MakeObject<Run>(doc, u"Text in its default position. ");
para->AppendChild(run);
// Add a run of text that appears as subscript.
run = MakeObject<Run>(doc, u"Subscript. ");
run->get_Font()->set_Subscript(true);
para->AppendChild(run);
// Add a run of text that appears as superscript.
run = MakeObject<Run>(doc, u"Superscript.");
run->get_Font()->set_Superscript(true);
para->AppendChild(run);
doc->Save(ArtifactsDir + u"Font.PositionSubscript.docx");

◆ get_Superscript()

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

True if the font is formatted as superscript.

Examples

Shows how to format text to offset its position.

auto doc = MakeObject<Document>();
auto para = System::DynamicCast<Paragraph>(doc->GetChild(NodeType::Paragraph, 0, true));
// Raise this run of text 5 points above the baseline.
auto run = MakeObject<Run>(doc, u"Raised text. ");
run->get_Font()->set_Position(5);
para->AppendChild(run);
// Lower this run of text 10 points below the baseline.
run = MakeObject<Run>(doc, u"Lowered text. ");
run->get_Font()->set_Position(-10);
para->AppendChild(run);
// Add a run of normal text.
run = MakeObject<Run>(doc, u"Text in its default position. ");
para->AppendChild(run);
// Add a run of text that appears as subscript.
run = MakeObject<Run>(doc, u"Subscript. ");
run->get_Font()->set_Subscript(true);
para->AppendChild(run);
// Add a run of text that appears as superscript.
run = MakeObject<Run>(doc, u"Superscript.");
run->get_Font()->set_Superscript(true);
para->AppendChild(run);
doc->Save(ArtifactsDir + u"Font.PositionSubscript.docx");

◆ get_TextEffect()

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

Gets or sets the font animation effect.

Examples

Shows how to apply a visual effect to a run.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);
builder->get_Font()->set_Size(36);
builder->get_Font()->set_TextEffect(TextEffect::SparkleText);
builder->Writeln(u"Text with a sparkle effect.");
// Older versions of Microsoft Word only support font animation effects.
doc->Save(ArtifactsDir + u"Font.SparklingText.doc");

◆ get_ThemeColor()

Aspose::Words::Themes::ThemeColor Aspose::Words::Font::get_ThemeColor ( )

Gets or sets the theme color in the applied color scheme that is associated with this Font object.

Examples

Shows how to work with theme fonts and colors.

auto doc = MakeObject<Document>();
// Define fonts for languages uses by default.
doc->get_Theme()->get_MinorFonts()->set_Latin(u"Algerian");
doc->get_Theme()->get_MinorFonts()->set_EastAsian(u"Aharoni");
doc->get_Theme()->get_MinorFonts()->set_ComplexScript(u"Andalus");
SharedPtr<Font> font = doc->get_Styles()->idx_get(u"Normal")->get_Font();
std::cout << String::Format(u"Originally the Normal style theme color is: {0} and RGB color is: {1}\n", font->get_ThemeColor(), font->get_Color())
<< std::endl;
// We can use theme font and color instead of default values.
font->set_ThemeFont(ThemeFont::Minor);
font->set_ThemeColor(ThemeColor::Accent2);
ASSERT_EQ(ThemeFont::Minor, font->get_ThemeFont());
ASSERT_EQ(u"Algerian", font->get_Name());
ASSERT_EQ(ThemeFont::Minor, font->get_ThemeFontAscii());
ASSERT_EQ(u"Algerian", font->get_NameAscii());
ASSERT_EQ(ThemeFont::Minor, font->get_ThemeFontBi());
ASSERT_EQ(u"Andalus", font->get_NameBi());
ASSERT_EQ(ThemeFont::Minor, font->get_ThemeFontFarEast());
ASSERT_EQ(u"Aharoni", font->get_NameFarEast());
ASSERT_EQ(ThemeFont::Minor, font->get_ThemeFontOther());
ASSERT_EQ(u"Algerian", font->get_NameOther());
ASSERT_EQ(ThemeColor::Accent2, font->get_ThemeColor());
ASPOSE_ASSERT_EQ(System::Drawing::Color::Empty, font->get_Color());
// There are several ways of reset them font and color.
// 1 - By setting ThemeFont.None/ThemeColor.None:
font->set_ThemeFont(ThemeFont::None);
font->set_ThemeColor(ThemeColor::None);
ASSERT_EQ(ThemeFont::None, font->get_ThemeFont());
ASSERT_EQ(u"Algerian", font->get_Name());
ASSERT_EQ(ThemeFont::None, font->get_ThemeFontAscii());
ASSERT_EQ(u"Algerian", font->get_NameAscii());
ASSERT_EQ(ThemeFont::None, font->get_ThemeFontBi());
ASSERT_EQ(u"Andalus", font->get_NameBi());
ASSERT_EQ(ThemeFont::None, font->get_ThemeFontFarEast());
ASSERT_EQ(u"Aharoni", font->get_NameFarEast());
ASSERT_EQ(ThemeFont::None, font->get_ThemeFontOther());
ASSERT_EQ(u"Algerian", font->get_NameOther());
ASSERT_EQ(ThemeColor::None, font->get_ThemeColor());
ASPOSE_ASSERT_EQ(System::Drawing::Color::Empty, font->get_Color());
// 2 - By setting non-theme font/color names:
font->set_Name(u"Arial");
ASSERT_EQ(ThemeFont::None, font->get_ThemeFont());
ASSERT_EQ(u"Arial", font->get_Name());
ASSERT_EQ(ThemeFont::None, font->get_ThemeFontAscii());
ASSERT_EQ(u"Arial", font->get_NameAscii());
ASSERT_EQ(ThemeFont::None, font->get_ThemeFontBi());
ASSERT_EQ(u"Arial", font->get_NameBi());
ASSERT_EQ(ThemeFont::None, font->get_ThemeFontFarEast());
ASSERT_EQ(u"Arial", font->get_NameFarEast());
ASSERT_EQ(ThemeFont::None, font->get_ThemeFontOther());
ASSERT_EQ(u"Arial", font->get_NameOther());
ASSERT_EQ(ThemeColor::None, font->get_ThemeColor());
ASSERT_EQ(System::Drawing::Color::get_Blue().ToArgb(), font->get_Color().ToArgb());

Shows how to create and use themed style.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);
builder->Writeln();
// Create some style with theme font properties.
SharedPtr<Style> style = doc->get_Styles()->Add(StyleType::Paragraph, u"ThemedStyle");
style->get_Font()->set_ThemeFont(ThemeFont::Major);
style->get_Font()->set_ThemeColor(ThemeColor::Accent5);
style->get_Font()->set_TintAndShade(0.3);
builder->get_ParagraphFormat()->set_StyleName(u"ThemedStyle");
builder->Writeln(u"Text with themed style");

◆ get_ThemeFont()

Aspose::Words::Themes::ThemeFont Aspose::Words::Font::get_ThemeFont ( )

Gets or sets the theme font in the applied font scheme that is associated with this Font object.

Examples

Shows how to work with theme fonts and colors.

auto doc = MakeObject<Document>();
// Define fonts for languages uses by default.
doc->get_Theme()->get_MinorFonts()->set_Latin(u"Algerian");
doc->get_Theme()->get_MinorFonts()->set_EastAsian(u"Aharoni");
doc->get_Theme()->get_MinorFonts()->set_ComplexScript(u"Andalus");
SharedPtr<Font> font = doc->get_Styles()->idx_get(u"Normal")->get_Font();
std::cout << String::Format(u"Originally the Normal style theme color is: {0} and RGB color is: {1}\n", font->get_ThemeColor(), font->get_Color())
<< std::endl;
// We can use theme font and color instead of default values.
font->set_ThemeFont(ThemeFont::Minor);
font->set_ThemeColor(ThemeColor::Accent2);
ASSERT_EQ(ThemeFont::Minor, font->get_ThemeFont());
ASSERT_EQ(u"Algerian", font->get_Name());
ASSERT_EQ(ThemeFont::Minor, font->get_ThemeFontAscii());
ASSERT_EQ(u"Algerian", font->get_NameAscii());
ASSERT_EQ(ThemeFont::Minor, font->get_ThemeFontBi());
ASSERT_EQ(u"Andalus", font->get_NameBi());
ASSERT_EQ(ThemeFont::Minor, font->get_ThemeFontFarEast());
ASSERT_EQ(u"Aharoni", font->get_NameFarEast());
ASSERT_EQ(ThemeFont::Minor, font->get_ThemeFontOther());
ASSERT_EQ(u"Algerian", font->get_NameOther());
ASSERT_EQ(ThemeColor::Accent2, font->get_ThemeColor());
ASPOSE_ASSERT_EQ(System::Drawing::Color::Empty, font->get_Color());
// There are several ways of reset them font and color.
// 1 - By setting ThemeFont.None/ThemeColor.None:
font->set_ThemeFont(ThemeFont::None);
font->set_ThemeColor(ThemeColor::None);
ASSERT_EQ(ThemeFont::None, font->get_ThemeFont());
ASSERT_EQ(u"Algerian", font->get_Name());
ASSERT_EQ(ThemeFont::None, font->get_ThemeFontAscii());
ASSERT_EQ(u"Algerian", font->get_NameAscii());
ASSERT_EQ(ThemeFont::None, font->get_ThemeFontBi());
ASSERT_EQ(u"Andalus", font->get_NameBi());
ASSERT_EQ(ThemeFont::None, font->get_ThemeFontFarEast());
ASSERT_EQ(u"Aharoni", font->get_NameFarEast());
ASSERT_EQ(ThemeFont::None, font->get_ThemeFontOther());
ASSERT_EQ(u"Algerian", font->get_NameOther());
ASSERT_EQ(ThemeColor::None, font->get_ThemeColor());
ASPOSE_ASSERT_EQ(System::Drawing::Color::Empty, font->get_Color());
// 2 - By setting non-theme font/color names:
font->set_Name(u"Arial");
ASSERT_EQ(ThemeFont::None, font->get_ThemeFont());
ASSERT_EQ(u"Arial", font->get_Name());
ASSERT_EQ(ThemeFont::None, font->get_ThemeFontAscii());
ASSERT_EQ(u"Arial", font->get_NameAscii());
ASSERT_EQ(ThemeFont::None, font->get_ThemeFontBi());
ASSERT_EQ(u"Arial", font->get_NameBi());
ASSERT_EQ(ThemeFont::None, font->get_ThemeFontFarEast());
ASSERT_EQ(u"Arial", font->get_NameFarEast());
ASSERT_EQ(ThemeFont::None, font->get_ThemeFontOther());
ASSERT_EQ(u"Arial", font->get_NameOther());
ASSERT_EQ(ThemeColor::None, font->get_ThemeColor());
ASSERT_EQ(System::Drawing::Color::get_Blue().ToArgb(), font->get_Color().ToArgb());

Shows how to create and use themed style.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);
builder->Writeln();
// Create some style with theme font properties.
SharedPtr<Style> style = doc->get_Styles()->Add(StyleType::Paragraph, u"ThemedStyle");
style->get_Font()->set_ThemeFont(ThemeFont::Major);
style->get_Font()->set_ThemeColor(ThemeColor::Accent5);
style->get_Font()->set_TintAndShade(0.3);
builder->get_ParagraphFormat()->set_StyleName(u"ThemedStyle");
builder->Writeln(u"Text with themed style");

◆ get_ThemeFontAscii()

Aspose::Words::Themes::ThemeFont Aspose::Words::Font::get_ThemeFontAscii ( )

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

Examples

Shows how to work with theme fonts and colors.

auto doc = MakeObject<Document>();
// Define fonts for languages uses by default.
doc->get_Theme()->get_MinorFonts()->set_Latin(u"Algerian");
doc->get_Theme()->get_MinorFonts()->set_EastAsian(u"Aharoni");
doc->get_Theme()->get_MinorFonts()->set_ComplexScript(u"Andalus");
SharedPtr<Font> font = doc->get_Styles()->idx_get(u"Normal")->get_Font();
std::cout << String::Format(u"Originally the Normal style theme color is: {0} and RGB color is: {1}\n", font->get_ThemeColor(), font->get_Color())
<< std::endl;
// We can use theme font and color instead of default values.
font->set_ThemeFont(ThemeFont::Minor);
font->set_ThemeColor(ThemeColor::Accent2);
ASSERT_EQ(ThemeFont::Minor, font->get_ThemeFont());
ASSERT_EQ(u"Algerian", font->get_Name());
ASSERT_EQ(ThemeFont::Minor, font->get_ThemeFontAscii());
ASSERT_EQ(u"Algerian", font->get_NameAscii());
ASSERT_EQ(ThemeFont::Minor, font->get_ThemeFontBi());
ASSERT_EQ(u"Andalus", font->get_NameBi());
ASSERT_EQ(ThemeFont::Minor, font->get_ThemeFontFarEast());
ASSERT_EQ(u"Aharoni", font->get_NameFarEast());
ASSERT_EQ(ThemeFont::Minor, font->get_ThemeFontOther());
ASSERT_EQ(u"Algerian", font->get_NameOther());
ASSERT_EQ(ThemeColor::Accent2, font->get_ThemeColor());
ASPOSE_ASSERT_EQ(System::Drawing::Color::Empty, font->get_Color());
// There are several ways of reset them font and color.
// 1 - By setting ThemeFont.None/ThemeColor.None:
font->set_ThemeFont(ThemeFont::None);
font->set_ThemeColor(ThemeColor::None);
ASSERT_EQ(ThemeFont::None, font->get_ThemeFont());
ASSERT_EQ(u"Algerian", font->get_Name());
ASSERT_EQ(ThemeFont::None, font->get_ThemeFontAscii());
ASSERT_EQ(u"Algerian", font->get_NameAscii());
ASSERT_EQ(ThemeFont::None, font->get_ThemeFontBi());
ASSERT_EQ(u"Andalus", font->get_NameBi());
ASSERT_EQ(ThemeFont::None, font->get_ThemeFontFarEast());
ASSERT_EQ(u"Aharoni", font->get_NameFarEast());
ASSERT_EQ(ThemeFont::None, font->get_ThemeFontOther());
ASSERT_EQ(u"Algerian", font->get_NameOther());
ASSERT_EQ(ThemeColor::None, font->get_ThemeColor());
ASPOSE_ASSERT_EQ(System::Drawing::Color::Empty, font->get_Color());
// 2 - By setting non-theme font/color names:
font->set_Name(u"Arial");
ASSERT_EQ(ThemeFont::None, font->get_ThemeFont());
ASSERT_EQ(u"Arial", font->get_Name());
ASSERT_EQ(ThemeFont::None, font->get_ThemeFontAscii());
ASSERT_EQ(u"Arial", font->get_NameAscii());
ASSERT_EQ(ThemeFont::None, font->get_ThemeFontBi());
ASSERT_EQ(u"Arial", font->get_NameBi());
ASSERT_EQ(ThemeFont::None, font->get_ThemeFontFarEast());
ASSERT_EQ(u"Arial", font->get_NameFarEast());
ASSERT_EQ(ThemeFont::None, font->get_ThemeFontOther());
ASSERT_EQ(u"Arial", font->get_NameOther());
ASSERT_EQ(ThemeColor::None, font->get_ThemeColor());
ASSERT_EQ(System::Drawing::Color::get_Blue().ToArgb(), font->get_Color().ToArgb());

◆ get_ThemeFontBi()

Aspose::Words::Themes::ThemeFont Aspose::Words::Font::get_ThemeFontBi ( )

Gets or sets the theme font in the applied font scheme that is associated with this Font object in a right-to-left language document.

Examples

Shows how to work with theme fonts and colors.

auto doc = MakeObject<Document>();
// Define fonts for languages uses by default.
doc->get_Theme()->get_MinorFonts()->set_Latin(u"Algerian");
doc->get_Theme()->get_MinorFonts()->set_EastAsian(u"Aharoni");
doc->get_Theme()->get_MinorFonts()->set_ComplexScript(u"Andalus");
SharedPtr<Font> font = doc->get_Styles()->idx_get(u"Normal")->get_Font();
std::cout << String::Format(u"Originally the Normal style theme color is: {0} and RGB color is: {1}\n", font->get_ThemeColor(), font->get_Color())
<< std::endl;
// We can use theme font and color instead of default values.
font->set_ThemeFont(ThemeFont::Minor);
font->set_ThemeColor(ThemeColor::Accent2);
ASSERT_EQ(ThemeFont::Minor, font->get_ThemeFont());
ASSERT_EQ(u"Algerian", font->get_Name());
ASSERT_EQ(ThemeFont::Minor, font->get_ThemeFontAscii());
ASSERT_EQ(u"Algerian", font->get_NameAscii());
ASSERT_EQ(ThemeFont::Minor, font->get_ThemeFontBi());
ASSERT_EQ(u"Andalus", font->get_NameBi());
ASSERT_EQ(ThemeFont::Minor, font->get_ThemeFontFarEast());
ASSERT_EQ(u"Aharoni", font->get_NameFarEast());
ASSERT_EQ(ThemeFont::Minor, font->get_ThemeFontOther());
ASSERT_EQ(u"Algerian", font->get_NameOther());
ASSERT_EQ(ThemeColor::Accent2, font->get_ThemeColor());
ASPOSE_ASSERT_EQ(System::Drawing::Color::Empty, font->get_Color());
// There are several ways of reset them font and color.
// 1 - By setting ThemeFont.None/ThemeColor.None:
font->set_ThemeFont(ThemeFont::None);
font->set_ThemeColor(ThemeColor::None);
ASSERT_EQ(ThemeFont::None, font->get_ThemeFont());
ASSERT_EQ(u"Algerian", font->get_Name());
ASSERT_EQ(ThemeFont::None, font->get_ThemeFontAscii());
ASSERT_EQ(u"Algerian", font->get_NameAscii());
ASSERT_EQ(ThemeFont::None, font->get_ThemeFontBi());
ASSERT_EQ(u"Andalus", font->get_NameBi());
ASSERT_EQ(ThemeFont::None, font->get_ThemeFontFarEast());
ASSERT_EQ(u"Aharoni", font->get_NameFarEast());
ASSERT_EQ(ThemeFont::None, font->get_ThemeFontOther());
ASSERT_EQ(u"Algerian", font->get_NameOther());
ASSERT_EQ(ThemeColor::None, font->get_ThemeColor());
ASPOSE_ASSERT_EQ(System::Drawing::Color::Empty, font->get_Color());
// 2 - By setting non-theme font/color names:
font->set_Name(u"Arial");
ASSERT_EQ(ThemeFont::None, font->get_ThemeFont());
ASSERT_EQ(u"Arial", font->get_Name());
ASSERT_EQ(ThemeFont::None, font->get_ThemeFontAscii());
ASSERT_EQ(u"Arial", font->get_NameAscii());
ASSERT_EQ(ThemeFont::None, font->get_ThemeFontBi());
ASSERT_EQ(u"Arial", font->get_NameBi());
ASSERT_EQ(ThemeFont::None, font->get_ThemeFontFarEast());
ASSERT_EQ(u"Arial", font->get_NameFarEast());
ASSERT_EQ(ThemeFont::None, font->get_ThemeFontOther());
ASSERT_EQ(u"Arial", font->get_NameOther());
ASSERT_EQ(ThemeColor::None, font->get_ThemeColor());
ASSERT_EQ(System::Drawing::Color::get_Blue().ToArgb(), font->get_Color().ToArgb());

◆ get_ThemeFontFarEast()

Aspose::Words::Themes::ThemeFont Aspose::Words::Font::get_ThemeFontFarEast ( )

Gets or sets the East Asian theme font in the applied font scheme that is associated with this Font object.

Examples

Shows how to work with theme fonts and colors.

auto doc = MakeObject<Document>();
// Define fonts for languages uses by default.
doc->get_Theme()->get_MinorFonts()->set_Latin(u"Algerian");
doc->get_Theme()->get_MinorFonts()->set_EastAsian(u"Aharoni");
doc->get_Theme()->get_MinorFonts()->set_ComplexScript(u"Andalus");
SharedPtr<Font> font = doc->get_Styles()->idx_get(u"Normal")->get_Font();
std::cout << String::Format(u"Originally the Normal style theme color is: {0} and RGB color is: {1}\n", font->get_ThemeColor(), font->get_Color())
<< std::endl;
// We can use theme font and color instead of default values.
font->set_ThemeFont(ThemeFont::Minor);
font->set_ThemeColor(ThemeColor::Accent2);
ASSERT_EQ(ThemeFont::Minor, font->get_ThemeFont());
ASSERT_EQ(u"Algerian", font->get_Name());
ASSERT_EQ(ThemeFont::Minor, font->get_ThemeFontAscii());
ASSERT_EQ(u"Algerian", font->get_NameAscii());
ASSERT_EQ(ThemeFont::Minor, font->get_ThemeFontBi());
ASSERT_EQ(u"Andalus", font->get_NameBi());
ASSERT_EQ(ThemeFont::Minor, font->get_ThemeFontFarEast());
ASSERT_EQ(u"Aharoni", font->get_NameFarEast());
ASSERT_EQ(ThemeFont::Minor, font->get_ThemeFontOther());
ASSERT_EQ(u"Algerian", font->get_NameOther());
ASSERT_EQ(ThemeColor::Accent2, font->get_ThemeColor());
ASPOSE_ASSERT_EQ(System::Drawing::Color::Empty, font->get_Color());
// There are several ways of reset them font and color.
// 1 - By setting ThemeFont.None/ThemeColor.None:
font->set_ThemeFont(ThemeFont::None);
font->set_ThemeColor(ThemeColor::None);
ASSERT_EQ(ThemeFont::None, font->get_ThemeFont());
ASSERT_EQ(u"Algerian", font->get_Name());
ASSERT_EQ(ThemeFont::None, font->get_ThemeFontAscii());
ASSERT_EQ(u"Algerian", font->get_NameAscii());
ASSERT_EQ(ThemeFont::None, font->get_ThemeFontBi());
ASSERT_EQ(u"Andalus", font->get_NameBi());
ASSERT_EQ(ThemeFont::None, font->get_ThemeFontFarEast());
ASSERT_EQ(u"Aharoni", font->get_NameFarEast());
ASSERT_EQ(ThemeFont::None, font->get_ThemeFontOther());
ASSERT_EQ(u"Algerian", font->get_NameOther());
ASSERT_EQ(ThemeColor::None, font->get_ThemeColor());
ASPOSE_ASSERT_EQ(System::Drawing::Color::Empty, font->get_Color());
// 2 - By setting non-theme font/color names:
font->set_Name(u"Arial");
ASSERT_EQ(ThemeFont::None, font->get_ThemeFont());
ASSERT_EQ(u"Arial", font->get_Name());
ASSERT_EQ(ThemeFont::None, font->get_ThemeFontAscii());
ASSERT_EQ(u"Arial", font->get_NameAscii());
ASSERT_EQ(ThemeFont::None, font->get_ThemeFontBi());
ASSERT_EQ(u"Arial", font->get_NameBi());
ASSERT_EQ(ThemeFont::None, font->get_ThemeFontFarEast());
ASSERT_EQ(u"Arial", font->get_NameFarEast());
ASSERT_EQ(ThemeFont::None, font->get_ThemeFontOther());
ASSERT_EQ(u"Arial", font->get_NameOther());
ASSERT_EQ(ThemeColor::None, font->get_ThemeColor());
ASSERT_EQ(System::Drawing::Color::get_Blue().ToArgb(), font->get_Color().ToArgb());

◆ get_ThemeFontOther()

Aspose::Words::Themes::ThemeFont Aspose::Words::Font::get_ThemeFontOther ( )

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

Examples

Shows how to work with theme fonts and colors.

auto doc = MakeObject<Document>();
// Define fonts for languages uses by default.
doc->get_Theme()->get_MinorFonts()->set_Latin(u"Algerian");
doc->get_Theme()->get_MinorFonts()->set_EastAsian(u"Aharoni");
doc->get_Theme()->get_MinorFonts()->set_ComplexScript(u"Andalus");
SharedPtr<Font> font = doc->get_Styles()->idx_get(u"Normal")->get_Font();
std::cout << String::Format(u"Originally the Normal style theme color is: {0} and RGB color is: {1}\n", font->get_ThemeColor(), font->get_Color())
<< std::endl;
// We can use theme font and color instead of default values.
font->set_ThemeFont(ThemeFont::Minor);
font->set_ThemeColor(ThemeColor::Accent2);
ASSERT_EQ(ThemeFont::Minor, font->get_ThemeFont());
ASSERT_EQ(u"Algerian", font->get_Name());
ASSERT_EQ(ThemeFont::Minor, font->get_ThemeFontAscii());
ASSERT_EQ(u"Algerian", font->get_NameAscii());
ASSERT_EQ(ThemeFont::Minor, font->get_ThemeFontBi());
ASSERT_EQ(u"Andalus", font->get_NameBi());
ASSERT_EQ(ThemeFont::Minor, font->get_ThemeFontFarEast());
ASSERT_EQ(u"Aharoni", font->get_NameFarEast());
ASSERT_EQ(ThemeFont::Minor, font->get_ThemeFontOther());
ASSERT_EQ(u"Algerian", font->get_NameOther());
ASSERT_EQ(ThemeColor::Accent2, font->get_ThemeColor());
ASPOSE_ASSERT_EQ(System::Drawing::Color::Empty, font->get_Color());
// There are several ways of reset them font and color.
// 1 - By setting ThemeFont.None/ThemeColor.None:
font->set_ThemeFont(ThemeFont::None);
font->set_ThemeColor(ThemeColor::None);
ASSERT_EQ(ThemeFont::None, font->get_ThemeFont());
ASSERT_EQ(u"Algerian", font->get_Name());
ASSERT_EQ(ThemeFont::None, font->get_ThemeFontAscii());
ASSERT_EQ(u"Algerian", font->get_NameAscii());
ASSERT_EQ(ThemeFont::None, font->get_ThemeFontBi());
ASSERT_EQ(u"Andalus", font->get_NameBi());
ASSERT_EQ(ThemeFont::None, font->get_ThemeFontFarEast());
ASSERT_EQ(u"Aharoni", font->get_NameFarEast());
ASSERT_EQ(ThemeFont::None, font->get_ThemeFontOther());
ASSERT_EQ(u"Algerian", font->get_NameOther());
ASSERT_EQ(ThemeColor::None, font->get_ThemeColor());
ASPOSE_ASSERT_EQ(System::Drawing::Color::Empty, font->get_Color());
// 2 - By setting non-theme font/color names:
font->set_Name(u"Arial");
ASSERT_EQ(ThemeFont::None, font->get_ThemeFont());
ASSERT_EQ(u"Arial", font->get_Name());
ASSERT_EQ(ThemeFont::None, font->get_ThemeFontAscii());
ASSERT_EQ(u"Arial", font->get_NameAscii());
ASSERT_EQ(ThemeFont::None, font->get_ThemeFontBi());
ASSERT_EQ(u"Arial", font->get_NameBi());
ASSERT_EQ(ThemeFont::None, font->get_ThemeFontFarEast());
ASSERT_EQ(u"Arial", font->get_NameFarEast());
ASSERT_EQ(ThemeFont::None, font->get_ThemeFontOther());
ASSERT_EQ(u"Arial", font->get_NameOther());
ASSERT_EQ(ThemeColor::None, font->get_ThemeColor());
ASSERT_EQ(System::Drawing::Color::get_Blue().ToArgb(), font->get_Color().ToArgb());

◆ get_ThemeProvider()

System::SharedPtr<Aspose::Words::Drawing::Core::Dml::Themes::IThemeProvider> Aspose::Words::Font::get_ThemeProvider ( )
override

◆ get_TintAndShade()

double Aspose::Words::Font::get_TintAndShade ( )

Gets or sets a double value that lightens or darkens a color.

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 ArgumentOutOfRangeException.

Setting this property for Font object with non-theme colors results in a InvalidOperationException.

Examples

Shows how to create and use themed style.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);
builder->Writeln();
// Create some style with theme font properties.
SharedPtr<Style> style = doc->get_Styles()->Add(StyleType::Paragraph, u"ThemedStyle");
style->get_Font()->set_ThemeFont(ThemeFont::Major);
style->get_Font()->set_ThemeColor(ThemeColor::Accent5);
style->get_Font()->set_TintAndShade(0.3);
builder->get_ParagraphFormat()->set_StyleName(u"ThemedStyle");
builder->Writeln(u"Text with themed style");

◆ get_Transparency()

double Aspose::Words::Font::get_Transparency ( )
override

◆ get_Underline()

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

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

Examples

Shows how to insert formatted text using DocumentBuilder.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);
// Specify font formatting, then add text.
SharedPtr<Aspose::Words::Font> font = builder->get_Font();
font->set_Size(16);
font->set_Bold(true);
font->set_Name(u"Courier New");
font->set_Underline(Underline::Dash);
builder->Write(u"Hello world!");

Shows how to insert a hyperlink field.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);
builder->Write(u"For more information, please visit the ");
// Insert a hyperlink and emphasize it with custom formatting.
// The hyperlink will be a clickable piece of text which will take us to the location specified in the URL.
builder->get_Font()->set_Color(System::Drawing::Color::get_Blue());
builder->get_Font()->set_Underline(Underline::Single);
builder->InsertHyperlink(u"Google website", u"https://www.google.com", false);
builder->get_Font()->ClearFormatting();
builder->Writeln(u".");
// Ctrl + left clicking the link in the text in Microsoft Word will take us to the URL via a new web browser window.
doc->Save(ArtifactsDir + u"DocumentBuilder.InsertHyperlink.docx");

Shows how to configure the style and color of a text underline.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);
builder->get_Font()->set_Underline(Underline::Dotted);
builder->get_Font()->set_UnderlineColor(System::Drawing::Color::get_Red());
builder->Writeln(u"Underlined text.");
doc->Save(ArtifactsDir + u"Font.Underlines.docx");

◆ get_UnderlineColor()

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

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

Examples

Shows how to configure the style and color of a text underline.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);
builder->get_Font()->set_Underline(Underline::Dotted);
builder->get_Font()->set_UnderlineColor(System::Drawing::Color::get_Red());
builder->Writeln(u"Underlined text.");
doc->Save(ArtifactsDir + u"Font.Underlines.docx");

◆ get_Visible()

bool Aspose::Words::Font::get_Visible ( )
override

◆ GetPresetTexture()

Aspose::Words::Drawing::PresetTexture Aspose::Words::Font::GetPresetTexture ( )
override

◆ GetType()

virtual const System::TypeInfo& Aspose::Words::Font::GetType ( ) const
overridevirtual

◆ 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.
Examples

Shows how to check if a run displays a DrawingML text effect.

auto doc = MakeObject<Document>(MyDir + u"DrawingML text effects.docx");
SharedPtr<RunCollection> runs = doc->get_FirstSection()->get_Body()->get_FirstParagraph()->get_Runs();
ASSERT_TRUE(runs->idx_get(0)->get_Font()->HasDmlEffect(TextDmlEffect::Shadow));
ASSERT_TRUE(runs->idx_get(1)->get_Font()->HasDmlEffect(TextDmlEffect::Shadow));
ASSERT_TRUE(runs->idx_get(2)->get_Font()->HasDmlEffect(TextDmlEffect::Reflection));
ASSERT_TRUE(runs->idx_get(3)->get_Font()->HasDmlEffect(TextDmlEffect::Effect3D));
ASSERT_TRUE(runs->idx_get(4)->get_Font()->HasDmlEffect(TextDmlEffect::Fill));

◆ Is()

virtual bool Aspose::Words::Font::Is ( const System::TypeInfo target) const
overridevirtual

◆ PresetTextured()

void Aspose::Words::Font::PresetTextured ( Aspose::Words::Drawing::PresetTexture  presetTexture)
override

◆ set_AllCaps()

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

◆ set_BackColor()

void Aspose::Words::Font::set_BackColor ( System::Drawing::Color  value)
override

◆ 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_EmphasisMark()

void Aspose::Words::Font::set_EmphasisMark ( Aspose::Words::EmphasisMark  value)

◆ set_Engrave()

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

◆ set_FilledColor()

void Aspose::Words::Font::set_FilledColor ( System::Drawing::Color  value)
override

◆ set_ForeColor()

void Aspose::Words::Font::set_ForeColor ( System::Drawing::Color  value)
override

◆ 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_On()

void Aspose::Words::Font::set_On ( bool  value)
override

◆ set_Opacity()

void Aspose::Words::Font::set_Opacity ( double  value)
override

◆ set_Outline()

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

◆ set_Position()

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

◆ set_RotateWithObject()

void Aspose::Words::Font::set_RotateWithObject ( bool  value)
override

◆ 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_SnapToGrid()

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

Specifies whether the current font should use the document grid characters per line settings when laying out.

◆ 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_ThemeColor()

void Aspose::Words::Font::set_ThemeColor ( Aspose::Words::Themes::ThemeColor  value)

◆ set_ThemeFont()

void Aspose::Words::Font::set_ThemeFont ( Aspose::Words::Themes::ThemeFont  value)

◆ set_ThemeFontAscii()

void Aspose::Words::Font::set_ThemeFontAscii ( Aspose::Words::Themes::ThemeFont  value)

◆ set_ThemeFontBi()

void Aspose::Words::Font::set_ThemeFontBi ( Aspose::Words::Themes::ThemeFont  value)

◆ set_ThemeFontFarEast()

void Aspose::Words::Font::set_ThemeFontFarEast ( Aspose::Words::Themes::ThemeFont  value)

◆ set_ThemeFontOther()

void Aspose::Words::Font::set_ThemeFontOther ( Aspose::Words::Themes::ThemeFont  value)

◆ set_TintAndShade()

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

◆ set_Transparency()

void Aspose::Words::Font::set_Transparency ( double  value)
override

◆ set_Underline()

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

◆ set_UnderlineColor()

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

◆ set_Visible()

void Aspose::Words::Font::set_Visible ( bool  value)
override

◆ SetFill()

void Aspose::Words::Font::SetFill ( System::SharedPtr< Aspose::Words::Drawing::Core::IFill >  fill)
override

◆ Solid()

void Aspose::Words::Font::Solid ( )
override

◆ Type()

static const System::TypeInfo& Aspose::Words::Font::Type ( )
static