You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • Hi - yes, what you suggest would work fine and shouldn't use too much memory.

    However even just doing:

    if (settings.font = ...) {
      Graphics.prototype.setFontArchitect = function() {
       ...
      }
    } else if (settings.font = ...) {
      Graphics.prototype.setFontArchitect = function() {
       ...
      }
    } 
    

    is enough that the code will run without using up any RAM for a font that isn't used. It's worth noting that the Graphics.prototype.setFontArchitect function will only ever use maybe 5 JS variables regardless of the size of its contents (because it's stored in flash), so even 7 of them won't use up all your memory.

    I would however ask the question: does your app really need 7 optional fonts? Will anyone actually use them all, or is it better to just have a single, good, well-tested font?

About

Avatar for Gordon @Gordon started