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

Font Class

Defines a font in the document.

#Declaration

TypeScript
export class Font

#Properties

#cssName Property

Returns a name of the font’s CSS class.

#Declaration

TypeScript
get cssName(): string

#Property Value

Type Description
string

The CSS class name.

#name Property

Returns a name of the font.

#Declaration

TypeScript
get name(): string

#Property Value

Type Description
string

The font name.

#Methods

#delete Method

Deletes the current font.

#Declaration

TypeScript
delete(): void

#Remarks

//reduces the document's font collection to the specified fonts
var myFonts = ['Arial', 'Calibri'];
richEdit.document.fonts.getAllFontNames().forEach(fontName => 
    myFonts.find(myFontName => 
        myFontName == fontName) ? null : richEdit.document.fonts.getByName(fontName).delete());