@mocanvas/editor · type

RichTextFontVisitor

type RichTextFontVisitor = (node: TiptapNode, state: RichTextFontVisitorState, addFont: (font: TLFontFace) => void) => RichTextFontVisitorState

Called for each node while collecting fonts.

Call addFont for every face the node needs, and return the state its children should inherit. Returning the state unchanged is the common case — most nodes are structural and change no formatting.

mocanvas is built by Symbio. Free for non-commercial, non-profit and development use; commercial use needs an agreement. Not affiliated with or endorsed by tldraw.