FontMappingsSettingsBuilder.DefaultFontName(String) Method

Specifies a font to which font families are mapped by default.

Namespace: DevExpress.AspNetCore.RichEdit

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

Declaration

public FontMappingsSettingsBuilder DefaultFontName(
    string defaultFontName
)

Parameters

Name Type Description
defaultFontName String

The font name.

Returns

Type Description
FontMappingsSettingsBuilder

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

Remarks

Call the DefaultFontName method to specify a default font used if the control cannot find a matching rule in the mapping rule collection.

@(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");
        });
    })
)
IMPORTANT

You must define the default font if you specify custom font settings for the control.

For more information, see the Font Management topic.

See Also