@flowscripter/dynamic-cli-framework
    Preparing search index...

    Interface AsciiBannerGeneratorService

    Service allowing a text string to be rendered using an ASCII banner font.

    interface AsciiBannerGeneratorService {
        generate(
            message: string,
            options?: BannerGenerateOptions,
        ): Promise<string>;
        getRegisteredFonts(): readonly string[];
        registerFont(fontName: string, fontDefinition: string): void;
    }

    Implemented by

    Index
    • Generate an ASCII banner text for the message using the specified options.

      Parameters

      • message: string

        the message to output.

      • Optionaloptions: BannerGenerateOptions

        optional generation options.

      Returns Promise<string>

    • Return the names of the currently registered fonts.

      Returns readonly string[]

    • 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" };

      Parameters

      • fontName: string

        the name used to refer to the font.

      • fontDefinition: string

        the definition for the syntax conforming to the FIGfont format.

      Returns void