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: 
tutash
Binge Watcher

LabelList custom fonts

I'm using a font node for a LabelList. I noticed that the font switches back to the default font for whichever item is focused. 
<LabelList id="list" itemSize="[860, 90]"
vertFocusAnimationStyle="floatingFocus">
<font 
role="font" 
uri="pkg:/fonts/DINOT-Medium.otf" 
size="44" />
</LabelList>


Is there a way to fix this?
0 Kudos
3 REPLIES 3
Tyler_Smith
Streaming Star

Re: LabelList custom fonts

https://sdkdocs.roku.com/display/sdkdoc ... ist+Markup has an example of programatically applying a focusedFont value to the LabelList that should give you the result you are looking for (very bottom of page).
Tyler Smith
0 Kudos
wizaro
Visitor

Re: LabelList custom fonts

You can also do something like:

  font = CreateObject("roSGNode", "Font")
  font.uri = "pkg:/fonts/font.ttf"
  font.size = 30
  
  m.list = m.top.FindNode("list") 
  m.list.font = font
  m.list.focusedFont = font
  m.list.focusedFont.size = font.size+5
0 Kudos
balbant
Streaming Star

Re: LabelList custom fonts

You Should add one more font tag for focused font, under of LabelList.
Try it:-
<LabelList id="list" itemSize="[860, 90]" vertFocusAnimationStyle="floatingFocus">
 <font role="font" uri="pkg:/fonts/DINOT-Medium.otf" size="44" />
 <Font role="focusedFont" uri="pkg:/fonts/DINOT-Medium.otf" size="44" />
</LabelList>
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.