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

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
Tyler_Smith
Level 7

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
Senior Developer, REDspace
redspace.com
0 Kudos
wizaro
Level 7

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

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>
0 Kudos