Getting Font from context fails

When trying to get a font from context in a script, you get a runtime error saying “attempt to call missing method ‘font’ of table”, but no compiler error