officefileapi-devexpress-dot-spreadsheet-cbc39e84.md
Contains font attributes for a rich text run.
Namespace : DevExpress.Spreadsheet
Assembly : DevExpress.Spreadsheet.v25.2.Core.dll
NuGet Package : DevExpress.Spreadsheet.Core
public class RichTextRunFont :
SpreadsheetFont,
IEquatable<SpreadsheetFont>
Public Class RichTextRunFont
Implements SpreadsheetFont,
IEquatable(Of SpreadsheetFont)
The following members return RichTextRunFont objects:
The RichTextRunFont object’s properties allow you to specify font settings for individual regions of the cell text (so-called text runs defined by the RichTextRun objects).
You can apply rich formatting to a cell text in one of the following ways:
Call the CellRange.SetRichText method to assign the rich formatted text to a cell.
To view font settings applied to an existing run, use the run’s RichTextRun.Font property.
Refer to the How to: Apply Rich Formatting to Cell Text document for examples on how to apply different fonts to specific regions of the cell text.
// Create a RichTextString instance.
RichTextString richText = new RichTextString();
// Add three text runs. Each run has its own font settings.
richText.AddTextRun("Rich ", new RichTextRunFont("Arial", 14, System.Drawing.Color.FromArgb(0xc5, 0x9f, 0xc9)));
richText.AddTextRun("text ", new RichTextRunFont("Tahoma", 14, System.Drawing.Color.FromArgb(0x2c, 0x60, 0x8e)));
richText.AddTextRun("formatting", new RichTextRunFont("Castellar", 14, System.Drawing.Color.FromArgb(0x2f, 0x24, 0x4f)));
// Assign the rich formatted text to the cell B2.
worksheet["B2"].SetRichText(richText);
' Create a RichTextString instance.
Dim richText As New RichTextString()
' Add three text runs. Each run has its own font settings.
richText.AddTextRun("Rich ", New RichTextRunFont("Arial", 14, System.Drawing.Color.FromArgb(&Hc5, &H9f, &Hc9)))
richText.AddTextRun("text ", New RichTextRunFont("Tahoma", 14, System.Drawing.Color.FromArgb(&H2c, &H60, &H8e)))
richText.AddTextRun("formatting", New RichTextRunFont("Castellar", 14, System.Drawing.Color.FromArgb(&H2f, &H24, &H4f)))
' Assign the rich formatted text to the cell B2.
worksheet("B2").SetRichText(richText)
Object RichTextRunFont
See Also