Back to Devexpress

Font Class

aspnetcore-js-devexpress-dot-richedit-68e38512.md

latest977 B
Original Source

Font Class

Defines a font in the document.

Declaration

ts
export class Font

Properties

cssName Property

Returns a name of the font’s CSS class.

Declaration

ts
get cssName(): string

Property Value

TypeDescription
string

The CSS class name.

|

name Property

Returns a name of the font.

Declaration

ts
get name(): string

Property Value

TypeDescription
string

The font name.

|

Methods

delete Method

Deletes the current font.

Declaration

ts
delete(): void

Remarks

javascript
//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());