Technique to handle fonts

I’m beginning to understand a little more how to handle Corona’s api and I wanted to ask if this would be a good technique to handle fonts. I’m on a phone so I do not going to use the <>

*****************************
–In main lua set a local variable to pass a font as a string
local font = “myFont.ttf”
composer.setVariable( font )
*****************************
–In scenes
local text1 = display.newText( “Font Test!”, 100, 200, composer.getVariable(font), 16 )
*****************************
Or
*****************************
At the top of each scene module set a local variable to use “font”
local sceneFont = composer. getVariable( font)
–create
local text1 = display.newText( “Font Test!”, 100, 200, sceneFont, 16 )

I’d go with the second one.

Or this…
 

-- common.lua local common = {} common.font1 = "bubba.ttf" common.font2 = "sue.ttf" return common

At the top of each scene file local common = require "common" --create local text1 = display.newText( "Font Test!", 100, 200, common.font1, 16 )

thanks @roaminggamer!

In the common module can I add the sound in the same way? I only have one font and two sounds. My concern is how the memory and app performance is it going to behave when module it is no longer required? Lua takes care of it?

I’d go with the second one.

Or this…
 

-- common.lua local common = {} common.font1 = "bubba.ttf" common.font2 = "sue.ttf" return common

At the top of each scene file local common = require "common" --create local text1 = display.newText( "Font Test!", 100, 200, common.font1, 16 )

thanks @roaminggamer!

In the common module can I add the sound in the same way? I only have one font and two sounds. My concern is how the memory and app performance is it going to behave when module it is no longer required? Lua takes care of it?