Back to Devexpress

CharacterPropertiesBase.FontName Property

officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-characterpropertiesbase-f04185c0.md

latest5.8 KB
Original Source

CharacterPropertiesBase.FontName Property

Gets or sets the character(s) font name.

Namespace : DevExpress.XtraRichEdit.API.Native

Assembly : DevExpress.RichEdit.v25.2.Core.dll

NuGet Package : DevExpress.RichEdit.Core

Declaration

csharp
string FontName { get; set; }
vb
Property FontName As String

Property Value

TypeDescription
String

A String value representing the font name or null for a mixture of font faces.

|

Remarks

Use the CharacterProperties interface to change character formatting.

The following code snippets (auto-collected from DevExpress Examples) contain references to the FontName property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

winforms-richedit-document-api/CS/RichEditAPISample/CodeExamples/Formatting.cs#L22

csharp
CharacterProperties cp = document.BeginUpdateCharacters(range);
cp.FontName = "Comic Sans MS";
cp.FontSize = 18;

wpf-richedit-document-api/CS/DXRichEditControlAPISample/CodeExamples/FormattingActions.cs#L17

csharp
CharacterProperties cp = document.BeginUpdateCharacters(range);
cp.FontName = "Comic Sans MS";
cp.FontSize = 18;

word-document-api-examples/CS/CodeExamples/StylesActions.cs#L38

csharp
cstyle.Strikeout = StrikeoutType.Double;
cstyle.FontName = "Verdana";
// Add the style to the collection of character styles.

winforms-rich-edit-text-formatting/CS/Text Formatting Example/Form1.cs#L52

csharp
titleFormatting.FontSize = 20;
titleFormatting.FontName = "Helvetica";
titleFormatting.ForeColor = Color.DarkBlue;

winforms-richedit-tables-simple-example/CS/TablesSimpleExample/Form1.cs#L130

csharp
CharacterProperties properties = document.BeginUpdateCharacters(table[0, 2].ContentRange);
properties.FontName = "Segoe UI";
properties.FontSize = 16;

winforms-richedit-document-api/VB/RichEditAPISample/CodeExamples/Formatting.vb#L20

vb
Dim cp As DevExpress.XtraRichEdit.API.Native.CharacterProperties = document.BeginUpdateCharacters(range)
cp.FontName = "Comic Sans MS"
cp.FontSize = 18

wpf-richedit-document-api/VB/DXRichEditControlAPISample/CodeExamples/FormattingActions.vb#L14

vb
Dim cp As CharacterProperties = document.BeginUpdateCharacters(range)
cp.FontName = "Comic Sans MS"
cp.FontSize = 18

word-document-api-examples/VB/CodeExamples/FormattingActions.vb#L35

vb
' Specify character formatting options.
cp.FontName = "Comic Sans MS"
cp.FontSize = 18

winforms-rich-edit-text-formatting/VB/Text Formatting Example/Form1.vb#L49

vb
titleFormatting.FontSize = 20
titleFormatting.FontName = "Helvetica"
titleFormatting.ForeColor = Color.DarkBlue

winforms-richedit-tables-simple-example/VB/TablesSimpleExample/Form1.vb#L106

vb
Dim properties As CharacterProperties = document.BeginUpdateCharacters(table(0, 2).ContentRange)
properties.FontName = "Segoe UI"
properties.FontSize = 16

See Also

ShowFontFormCommand

CharacterPropertiesBase Interface

CharacterPropertiesBase Members

DevExpress.XtraRichEdit.API.Native Namespace