Skip to main content
JS

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

RichEditBuilder.Fonts(Action<FontsSettingsBuilder>) Method

Specifies font settings.

Namespace: DevExpress.AspNetCore.RichEdit

Assembly: DevExpress.AspNetCore.RichEdit.v24.2.dll

NuGet Package: DevExpress.AspNetCore.RichEdit

#Declaration

C#
public RichEditBuilder Fonts(
    Action<FontsSettingsBuilder> configure
)

#Parameters

Name Type Description
configure Action<FontsSettingsBuilder>

A delegate method that specifies font settings.

#Returns

Type Description
RichEditBuilder

An object that can be used to further configure the Rich Text Editor.

#Remarks

Use the Fonts method to provide information about fonts available in the control (the AddFont method overloads) and specify mapping rules (Mapping(Action<FontMappingsSettingsBuilder>)) that are applied to unavailable fonts.

@(Html.DevExpress().RichEdit("richEdit")
    .Fonts(f => {
        f.DefaultFolder("fontsFolder");
        f.AddFont("Calibri", "Calibri", false, "CalibriFont/calibri.ttf", "CalibriFont/calibrib.ttf", "CalibriFont/calibrii.ttf", "CalibriFont/calibriz.ttf");
        f.AddFont("Comic", "Comic");
        f.AddFont("Lemonada", "Lemonada", true);
        f.AddFont("Roboto Mono", "Roboto Mono", true);
        f.Mapping(m => {
            m.DefaultFontName("Calibri");
            m.AddRule("Arial", "Comic");
            m.AddRule("Times", "Roboto Mono");
        });
    })
)

See the Font Management to learn more about fonts in the RichEdit control.

See Also