officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-characterpropertiesbase-f04185c0.md
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
string FontName { get; set; }
Property FontName As String
| Type | Description |
|---|---|
| String |
A String value representing the font name or null for a mixture of font faces.
|
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
CharacterProperties cp = document.BeginUpdateCharacters(range);
cp.FontName = "Comic Sans MS";
cp.FontSize = 18;
wpf-richedit-document-api/CS/DXRichEditControlAPISample/CodeExamples/FormattingActions.cs#L17
CharacterProperties cp = document.BeginUpdateCharacters(range);
cp.FontName = "Comic Sans MS";
cp.FontSize = 18;
word-document-api-examples/CS/CodeExamples/StylesActions.cs#L38
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
titleFormatting.FontSize = 20;
titleFormatting.FontName = "Helvetica";
titleFormatting.ForeColor = Color.DarkBlue;
winforms-richedit-tables-simple-example/CS/TablesSimpleExample/Form1.cs#L130
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
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
Dim cp As CharacterProperties = document.BeginUpdateCharacters(range)
cp.FontName = "Comic Sans MS"
cp.FontSize = 18
word-document-api-examples/VB/CodeExamples/FormattingActions.vb#L35
' Specify character formatting options.
cp.FontName = "Comic Sans MS"
cp.FontSize = 18
winforms-rich-edit-text-formatting/VB/Text Formatting Example/Form1.vb#L49
titleFormatting.FontSize = 20
titleFormatting.FontName = "Helvetica"
titleFormatting.ForeColor = Color.DarkBlue
winforms-richedit-tables-simple-example/VB/TablesSimpleExample/Form1.vb#L106
Dim properties As CharacterProperties = document.BeginUpdateCharacters(table(0, 2).ContentRange)
properties.FontName = "Segoe UI"
properties.FontSize = 16
See Also
CharacterPropertiesBase Interface