Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Search instead for 
Did you mean: 
georgejecook
Level 7

CreateObject("roFontRegistry") returns invalid anywhere except main app

I presume this is because of threading; but can't be sure as BrightScript seems to not have very thorough errors regarding thread boundaries (which I worked out the hard way after a tinkering about).

So - how am I meant to get hold of fonts anywhere outside of the main app?

I tried passing it around the globalAA; but that doens't work

BS has no global scope that seems to permit objects, that I can use (without it silently failing).

how does one do this? I'm trying to debug a font that's not appearing in my label btw. The font family is present in the main script; but despite using the family name, never shows up in my label.
George Cook
https://linkedin.com/in/georgejecook/
Roku developers slack group (http://tiny.cc/nrdf0y) : georgejecook

Contact me on roku developer slack group, or via pm to discuss consultancy/work opportunities/rooibos unit testing framework
0 Kudos
2 Replies
Roku Employee
Roku Employee

Re: CreateObject("roFontRegistry") returns invalid anywhere except main app

i don't believe RSG uses/considers roFontRegistry but rather Font node https://sdkdocs.roku.com/display/sdkdoc/Font
(fair warning, i don't now that corner)

Also note, getGlobalAA() is not shared between threads - nor can ro-components be passed between threads, generally speaking (with the notable exception of JSON-like structures from roArray and roAA). You may be able to create roFontRegistry in Task thread runner but not on render thread, IDK.
0 Kudos
georgejecook
Level 7

Re: CreateObject("roFontRegistry") returns invalid anywhere except main app

Thanks
George Cook
https://linkedin.com/in/georgejecook/
Roku developers slack group (http://tiny.cc/nrdf0y) : georgejecook

Contact me on roku developer slack group, or via pm to discuss consultancy/work opportunities/rooibos unit testing framework
0 Kudos