You are reading a single comment by @Asynchronous and its replies. Click here to read the full conversation.
  • I'm trying to add a a set of fonts to Graphics.
    The list is big, so I'm using an array. (Below list is just an example)

    // DOESN'T WORK
    ["FontTeletext10x18Mode7", "FontHaxorNarrow7x17", "Font8x12"].forEach((font) => {
        require(font).add(Graphics);
    });
    

    I get back an error, Module FontTeletext10x18Mode7 not found.
    However, adding them individually seems to work.

    // WORKS
    require("FontTeletext10x18Mode7").add(Gr­aphics);
    require("FontHaxorNarrow7x17").add(Graph­ics);
    require("Font8x12").add(Graphics);
    

    Why can't I use an array to add fonts?

About