lisakb140
7 years agoVisitor
Using custom fonts (.ttf files) in XML
I am trying to use 2 fonts (I have their ttf files saved in a folder within my project called "fonts"), and am having trouble incorporating them properly in my nodes in my xml files.
I've tried including this in my nodes:
but that doesn't work.
I've read that fonts need to be included in the fonts directory in a package file, following this example: https://sdkdocs.roku.com/display/sdkdoc/Font
Is there something I am doing wrong??
UPDATE:
I've also tried putting this directly in one of my .brs files
but I get an Error message saying this is an invalid path!
My fonts directory is top-level, as in it's the same level as my components folder. I don't understand why this path would be invalid!!
I've tried including this in my nodes:
font="pkg:/fonts/font:Muli-ExtraLight.ttf"
but that doesn't work.
I've read that fonts need to be included in the fonts directory in a package file, following this example: https://sdkdocs.roku.com/display/sdkdoc/Font
Is there something I am doing wrong??
UPDATE:
I've also tried putting this directly in one of my .brs files
[b]font[/b] = [i]CreateObject[/i]("roSGNode", "Font")
font.uri = "pkg:/fonts/font:Muli-ExtraLight.ttf"
but I get an Error message saying this is an invalid path!
My fonts directory is top-level, as in it's the same level as my components folder. I don't understand why this path would be invalid!!