All docs
V19.2
19.2
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.
.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+
.NET Core 3.0+

DocumentTheme Class

Represents a document theme.

Namespace: DevExpress.XtraRichEdit.API.Native

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

Declaration

public class DocumentTheme :
    IDocumentTheme
Public Class DocumentTheme
    Implements IDocumentTheme
public class DocumentTheme :
    IDocumentTheme
Public Class DocumentTheme
    Implements IDocumentTheme
public class DocumentTheme :
    IDocumentTheme
Public Class DocumentTheme
    Implements IDocumentTheme

Remarks

The DocumentTheme class is the default IDocumentTheme interface implementation that represents the document theme. Use the DocumentTheme class properties to specify theme fonts for East Asian, Latin and Complex Script languages.

The code sample below shows how to create a new DocumentTheme object and pass it as the Document.Theme property value:

//Create a new DocumentTheme object:
DocumentTheme theme = new DocumentTheme();

//Specify Body and Heading fonts for Complex Script...
theme.BodyComplexScript = "Microsoft Sans Serif";
theme.HeadingsComplexScript = "Tahoma";

//...Latin...
theme.HeadingsLatin = "Segoe UI Semilight";
theme.BodyLatin = "Times New Roman";

//..and East Asian languages:
theme.HeadingsEastAsia = "DengXian Light";
theme.BodyEastAsia = "DengXian";

//Set the created object as the Theme property value:
doc.Theme = theme;

// Specify theme font types used for Complex Script and East Asian languages:
CharacterProperties fontProperties = doc.BeginUpdateCharacters(doc.Range);

fontProperties.ThemeFontComplexScript = ThemeFont.HeadingsComplexScript;
fontProperties.ThemeFontEastAsia = ThemeFont.BodyEastAsia;

doc.EndUpdateCharacters(fontProperties);


//Save the result:
doc.SaveDocument("123456.docx", DocumentFormat.OpenXml);

Inheritance

Object
DocumentTheme

Implements

See Also