Skip to main content
JS

RichEditBuilder.Fonts(Action<FontsSettingsBuilder>) Method

Specifies font settings.

Namespace: DevExpress.AspNetCore.RichEdit

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

NuGet Package: DevExpress.AspNetCore.RichEdit

Declaration

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