Your Digital Media Has Never Looked So Good

 
Littlelies
Topic Author
Posts: 5
Joined: Sun Nov 13, 2016 6:59 am

Custom font for Rowlist label ?

Thu Nov 17, 2016 3:48 am

Hi, I would like to change the font for a rowlist label (to display Arabic chars).
I tried using rowLabelFont, but didn't manage to make it work.
How can I achieve that?
 
EnTerr
** Valued Community Member **
Posts: 3834
Joined: Sun Jan 02, 2011 2:41 am

Re: Custom font for Rowlist label ?

Thu Nov 17, 2016 9:15 am

Ha - WTH is type "font", i wonder?!
I mean, TFM says that rowLabelFont attribute type "font" but there is no such RSG type! (RSG types are enumerated here)
The doco imprecision can be vexing.
 
User avatar
RokuKC
Posts: 305
Joined: Wed Sep 10, 2014 10:44 am
Location: Roku HQ

Re: Custom font for Rowlist label ?

Thu Nov 17, 2016 10:22 am

EnTerr wrote:
Ha - WTH is type "font", i wonder?!


Possibly https://sdkdocs.roku.com/display/sdkdoc/Font will help.
 
EnTerr
** Valued Community Member **
Posts: 3834
Joined: Sun Jan 02, 2011 2:41 am

Re: Custom font for Rowlist label ?

Thu Nov 17, 2016 10:27 am

RokuKC wrote:
EnTerr wrote:
Ha - WTH is type "font", i wonder?!

Possibly https://sdkdocs.roku.com/display/sdkdoc/Font will help.

I am afraid not - can you elaborate how does one assign an XML element (which "Font" is) to an XML attribute (which "rowLabelFont" is)?
As a reminder, XML attributes cannot be structured. And to re-iterate, RSG attribute types do not list a "font" data type - so if not from XML, i have no clue how to do that from B/S...
 
User avatar
RokuKC
Posts: 305
Joined: Wed Sep 10, 2014 10:44 am
Location: Roku HQ

Re: Custom font for Rowlist label ?

Thu Nov 17, 2016 11:34 am

EnTerr wrote:
I am afraid not - can you elaborate how does one assign an XML element (which "Font" is) to an XML attribute (which "rowLabelFont" is)?


Your leopard-tracking skills are getting rusty. :roll: :wink:

Notice the "role" attribute in the Font node, mentioned in https://sdkdocs.roku.com/display/sdkdoc/Font .

See https://sdkdocs.roku.com/display/sdkdoc ... Components and search for "<Font>".

Also https://sdkdocs.roku.com/display/sdkdoc/Typography .
 
EnTerr
** Valued Community Member **
Posts: 3834
Joined: Sun Jan 02, 2011 2:41 am

Re: Custom font for Rowlist label ?

Thu Nov 17, 2016 12:09 pm

RokuKC wrote:
Your leopard-tracking skills are getting rusty. :roll: :wink:

"Yeah, a regular Rip van Winkle", apparently.
I can't believe i forgot about the "role" karnapidasana. Tsk-tsk - I am disappointed in you, me! :wink:

So to recap, the font can be 
  • specified as a string to the attribute (for system fonts)
  • assigned as roSgNode to the attribute (only in B/S)
  • or "the yoga role way" (only in XML)
 
lisakb140
Posts: 28
Joined: Tue Aug 14, 2018 8:18 am

Re: Custom font for Rowlist label ?

Thu Oct 11, 2018 10:20 am

I am struggling with this same issue---what did you end up doing to make this work??
 
ionatan
Posts: 106
Joined: Wed Aug 03, 2011 3:34 am

Re: Custom font for Rowlist label ?

Fri Oct 19, 2018 7:41 am

Did someone found a solution to use a custom font with rowlist label?

Update: role="rowLabelFont" would do it.
 
norcaljohnny
Posts: 51
Joined: Thu Apr 13, 2017 11:00 pm

Re: Custom font for Rowlist label ?

Tue Oct 23, 2018 2:53 pm

Here are the steps to use a custom font

1. create a folder named "fonts" in the root folder of your app (ie components, images, fonts. out, source)
2. place the font in the newly created "fonts" folder (ie fonts(folder) > yourFontFile.otf(file))
3. create some Brightscript code for a font node and label node. (in this case I am using Apples SanFrancisco font named sf.otf and placed it in my "fonts" folder)


      label = CreateObject("roSGNode", "Label")
      font  = CreateObject("roSGNode", "Font")
      font.uri = "pkg:/fonts/sf.otf"
      font.size = 20
      label.font = font


So, now whenever I use the label node the font used for it will be my custom sf.otf font with a font size of 20

<label id=title text="Just some title" />

Who is online

Users browsing this forum: No registered users and 4 guests