Service allowing a text string to be rendered using an ASCII banner FIGlet font.
registerFont(fontName: string,fontDefinition: string,): void
Register a new font.
The recommended way to load the font definition is to convert the font definition to a JSON string
(replacing newlines with \n
) and placing in a simple JSON file: { "font": "<figlet font definition>" }
.
This can then be imported as follows:
`import { font as myFont } from "./myfont.json" with { type: "json" };
getRegisteredFonts(): ReadonlyArray<string>
Return the names of the currently registered fonts.
generate(message: string,fontName: string,): Promise<string>
Generate an ASCII banner text for the message using the specified font.