Skip to main content

FontMappingsSettingsBuilder.AddRule(String, String) Method

Adds a new font mapping rule to the RichEdit control.

Namespace: DevExpress.AspNetCore.RichEdit

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

NuGet Package: DevExpress.AspNetCore.RichEdit

Declaration

public FontMappingsSettingsBuilder AddRule(
    string sourceFontFamily,
    string destinationFontName
)

Parameters

Name Type Description
sourceFontFamily String

A name of a font family that is mapped.

destinationFontName String

A font to which a source font family is mapped.

Returns

Type Description
FontMappingsSettingsBuilder

An object that can be used to further configure the RichEdit font mapping settings.

Remarks

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

For more information, see the Font Management topic.

See Also