Skip to main content

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

FontMappingsSettingsBuilder.AddRule(String, String) Method

Adds a new font mapping rule to the RichEdit control.

Namespace: DevExpress.AspNetCore.RichEdit

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

NuGet Package: DevExpress.AspNetCore.RichEdit

#Declaration

C#
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