Skip to main content

extension-font-family

package @remirror/extension-font-family

class FontFamilyExtension

Add a font family to the selected text (or text within a specified range).

Signature:

export declare class FontFamilyExtension extends MarkExtension 

Extends: MarkExtension

(Some inherited members may not be shown because they are not represented in the documentation.)

property name

Signature:

get name(): "fontFamily";

method createMarkSpec

Signature:

createMarkSpec(extra: ApplySchemaAttributes, override: MarkSpecOverride): MarkExtensionSpec;

Parameters:

ParameterTypeDescription
extraApplySchemaAttributes
overrideMarkSpecOverride

Returns:

MarkExtensionSpec

method createTags

Signature:

createTags(): ("formattingMark" | "fontStyle")[];

Returns:

("formattingMark" | "fontStyle")[]

method setFontFamily

Set the font family for the selected text.

Signature:

setFontFamily(fontFamily: string): CommandFunction;

Parameters:

ParameterTypeDescription
fontFamilystring

Returns:

CommandFunction

method toggleFontFamily

Set the font family for the selected text.

Signature:

toggleFontFamily(fontFamily: string): CommandFunction;

Parameters:

ParameterTypeDescription
fontFamilystring

Returns:

CommandFunction

type FontFamilyAttributes

Signature:

export type FontFamilyAttributes = ProsemirrorAttributes<{
fontFamily?: string;
}>;

References: ProsemirrorAttributes