TabloCraig
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2017
10:59 AM
roFontRegistry.getDefaultFont() returns invalid, sometimes
In our text label utility, we have the following:
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.
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.
3 REPLIES 3
rymawby
Binge Watcher
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2017
10:02 PM
Re: roFontRegistry.getDefaultFont() returns invalid, sometimes
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?
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?
TabloCraig
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2017
08:37 AM
Re: roFontRegistry.getDefaultFont() returns invalid, sometimes
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.
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
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2017
10:51 AM
Re: roFontRegistry.getDefaultFont() returns invalid, sometimes
Any thoughts on this? Was hoping to hear from the Roku team.