The Rich Text Editor ships with the DXFontRepository class that allows you to use fonts that are not installed on the current operating system. 'Specify theme font types used for Complex Script and East Asian languages:ĭim fontProperties As CharacterProperties = doc.BeginUpdateCharacters(doc.Range)įontProperties.ThemeFontComplexScript = ThemeFont.HeadingsComplexScriptįontProperties.ThemeFontEastAsia = ThemeFont.BodyEastAsiaĭoc.SaveDocument("123456.docx", DocumentFormat.OpenXml) 'Set the created object as the Theme property value: Theme.HeadingsEastAsia = "DengXian Light" Theme.HeadingsLatin = "Segoe UI Semilight" Theme.Bod圜omplexScript = "Microsoft Sans Serif" 'Specify Body and Heading fonts for Complex Script. Specify theme font types used for Complex Script and East Asian languages:ĬharacterProperties fontProperties = doc.BeginUpdateCharacters(doc.Range) įontProperties.ThemeFontComplexScript = ThemeFont.HeadingsComplexScript įontProperties.ThemeFontEastAsia = ThemeFont.BodyEastAsia ĭoc.SaveDocument("123456.docx", DocumentFormat.OpenXml) Set the created object as the Theme property value: Specify Body and Heading fonts for Complex Script. Create a new DocumentTheme object and pass it as the Theme property value, as shown in the code sample below:ĭocumentTheme theme = new DocumentTheme() You can use the Document.Theme property to specify Body and Heading fonts used in the document for Latin, Complex Script and East Asian languages. If the ThemeFontComplexScript is not specified, the CharacterPropertiesBase.FontNameComplexScript property determines the theme font. Specifies the name of the Complex Script theme font. If the ThemeFontHighAnsi is not specified, the CharacterPropertiesBase.FontNameHighAnsi property determines the theme font.ĬharacterPropertiesBase.ThemeFontComplexScript Specifies the theme font used to format High ANSI characters. If the ThemeFontEastAsia is not specified, the CharacterPropertiesBase.FontNameEastAsia property determines the theme font.ĬharacterPropertiesBase.ThemeFontHighAnsi Specifies the theme font used to format East Asian Unicode characters. If the ThemeFontAscii is not specified, CharacterPropertiesBase.FontNameAscii property determines the theme font.ĬharacterPropertiesBase.ThemeFontEastAsia Specifies the theme font used to format Unicode (U+0000–U+007F) characters. You can use the following properties to specify these fonts for a specific document range: Property Each set includes font names for different languages. A document theme contains two sets of fonts (Headings and Body). The Rich Text Editor supports theme fonts. TitleFormatting.ForeColor = Color.DarkBlue ĭocument.EndUpdateCharacters(titleFormatting) Set the character size, font name and color Provide access to the character propertiesĬharacterProperties titleFormatting = document.BeginUpdateCharacters(range) The target range is the first paragraphĭocumentRange range = TitleFormatting.ForeColor = Color.DarkBlueĭocument.EndUpdateCharacters(titleFormatting) 'Set the character size, font name and color 'Provide access to the character propertiesĭim titleFormatting As CharacterProperties = document.BeginUpdateCharacters(range) Specify these properties before initialization of all controls, in the Main method, as illustrated in the following code.ĭim range As DocumentRange = document.Paragraphs(0).Range The static RichEditControlCompatibility.DefaultFontSize and RichEditControlCompatibility.DefaultFontName properties set the default font settings for all RichEditControl instances in the application. 'Set the default font, size and forecolor Private Sub RichEditControl1_DocumentLoaded(ByVal sender As Object, ByVal e As EventArgs) Set the default font, size and forecolor Private void RichEditControl1_DocumentLoaded(object sender, EventArgs e)
0 Comments
Leave a Reply. |