from official doc:
function init(self)
local font = go.get("#label", "font")
local metrics = resource.get_text_metrics(font, "The quick brown fox\n jumps over the lazy dog")
pprint(metrics)
end
but i don’t use game object, if i try following:
local font = gui.get_font(self.text)
pprint(resource.get_text_metrics(font, "text"))
it gives error:
ERROR:EVENTCM: gui/templates/banner.lua:19: Could not get fontc type resource: sofia