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.
Module FontTeletext10x18Mode7 not found
// WORKS require("FontTeletext10x18Mode7").add(Graphics); require("FontHaxorNarrow7x17").add(Graphics); require("Font8x12").add(Graphics);
Why can't I use an array to add fonts?
@Asynchronous started
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
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)
I get back an error,
Module FontTeletext10x18Mode7 not found
.However, adding them individually seems to work.
Why can't I use an array to add fonts?