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: 
philotas
Level 7

Re: How to modify System Fonts in SceneGraph?

@belltown

thanks for showing me how to set the size for a system Font.
I am a little embarrassed that I did not try that myself... Smiley Surprisedops:

this code seemed a little weird, but obvioulsy setting the font of a Label to a string converts it to a Font Node
m.top.font = "font:LargeBoldSystemFont"
m.top.font.size = 20
0 Kudos
EnTerr
Level 9

Re: How to modify System Fonts in SceneGraph?

"philotas" wrote:
this code seemed a little weird, but obvioulsy setting the font of a Label to a string converts it to a Font Node
m.top.font = "font:LargeBoldSystemFont"
m.top.font.size = 20


It is weird, isn't it! :idea:
.font property is polymorphic, apparently - takes (and returns) font objects but if assigned string, converts it to a Font on the spot. And hence the next line works ("wait, what? how am i assigning number to a field in a string?!")
0 Kudos
philotas
Level 7

Re: How to modify System Fonts in SceneGraph?

Yes it is!
This could be at least documented...
0 Kudos
EnTerr
Level 9

Re: How to modify System Fonts in SceneGraph?

"philotas" wrote:
Yes it is!
This could be at least documented...

Documentation is for wimps! Smiley LOL
i suspect the docu-mentalist has jumped Roku ship (either that or RSG drove them past the verge of nervous breakdown?), since have not updated a single page in over 3 months.
Drop a request/note in viewtopic.php?f=34&t=69731, maybe someone will be shoring up
0 Kudos
belltown
Level 7

Re: How to modify System Fonts in SceneGraph?

Actually it does state in the documentation that you can set the font's size property, if that's what you were looking for:

In https://sdkdocs.roku.com/display/sdkdoc/Typography:

you can also set sizes explicitly using BrightScript:
m.mylargerlabel.font.size = m.mylargerlabel.font.size+5
https://github.com/belltown/
0 Kudos