Your Digital Media Has Never Looked So Good

 
TabloCraig
Topic Author
Posts: 4
Joined: Tue Apr 25, 2017 11:37 am

roFontRegistry.getDefaultFont() returns invalid, sometimes

Wed Oct 11, 2017 10:59 am

In our text label utility, we have the following:

fontRegistry = createObject("roFontRegistry")
font = fontRegistry.getDefaultFont()
assert(font <> invalid, "roFontRegistry.getDefaultFont() should return a font")


This assertion fails from time to time in production (according to the crash reporter found in the Roku Developer backend), but we have never witnessed it in our own testing.

One small item to note is this code is only encountered once, since the returned font is stored in the globalAA for future reference. Is there something that causes `getDefaultFont()` to return invalid under certain circumstances? We have a tight grip on bitmap memory usage and are confident that there is plenty available before this block of code is executed.
 
rymawby
Posts: 16
Joined: Fri Jan 16, 2015 9:03 am
Contact:

Re: roFontRegistry.getDefaultFont() returns invalid, sometimes

Wed Oct 11, 2017 10:02 pm

Hi TabloCraig,

According to the docs getDefaultFont should always return the system font without fail.

You mentioned you usage of getGlobalAA (which acts differently in SG apps to SDK1 apps) can you elaborate a bit further around this? Is the code above exactly what gets run?
 
---
Blogging Roku stuff at http://rymawby.com
---
 
TabloCraig
Topic Author
Posts: 4
Joined: Tue Apr 25, 2017 11:37 am

Re: roFontRegistry.getDefaultFont() returns invalid, sometimes

Thu Oct 12, 2017 8:37 am

We store the returned font in the global AA, after that block of code is executed once. I think that is a red herring and shouldn't have mentioned it.

The channel does not use SG other than for the player.

The block of code is a copy-paste from the file; the only thing I changed was the indentation. I believe there is either a bug with roFontRegistry, or we are doing something to cause a problem with it, though I can't be sure of what it would be.
 
TabloCraig
Topic Author
Posts: 4
Joined: Tue Apr 25, 2017 11:37 am

Re: roFontRegistry.getDefaultFont() returns invalid, sometimes

Thu Oct 19, 2017 10:51 am

Any thoughts on this? Was hoping to hear from the Roku team.

Who is online

Users browsing this forum: No registered users and 3 guests