Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
georgejecook
Streaming Star

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://georgejecook.github.io/
https://linkedin.com/in/georgejecook/
Roku developers slack group (https://join.slack.com/t/rokudevelopers/shared_invite/zt-4vw7rg6v-NH46oY7hTktpRIBM_zGvwA) : georgejecook

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

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.
georgejecook
Streaming Star

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

Thanks
George Cook
https://georgejecook.github.io/
https://linkedin.com/in/georgejecook/
Roku developers slack group (https://join.slack.com/t/rokudevelopers/shared_invite/zt-4vw7rg6v-NH46oY7hTktpRIBM_zGvwA) : georgejecook

Contact me on roku developer slack group, or via pm to discuss consultancy/work opportunities/rooibos unit testing framework
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.