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: 

Problem rendering font on newer rokus

I am using an open source .ttf font in an app that I developed and tested with an older series roku (e.g. Roku HD)

I am drawing text to a double buffered roScreen. Some of the rendered text is in my special font, other text is in the default system font.

On the older Roku, both fonts (and other simple graphics) work great.

However, when I run it on a newer roku (e.g. Roku 2 XS) the app runs without generating any errors (I see it executing with the expected "print" output on the telnet console), but it does not display anything in my special font. Text is rendered properly in the default font.

I understand that there are some model specific differences that need to be handled in code, but have been unable to identify anything specific for my circumstance.

I am creating the screen and font related objects as indicated here:



screen=CreateObject("roScreen", true, 1280, 720)
frg = CreateObject("roFontRegistry")
frg.Register("pkg:/fonts/Myspecialfont.ttf")
fonts = frg.GetFamilies()
font = frg.GetFont(fonts[0], 75, false, false)


I am drawing the text with commands like this:


screen.DrawText(myrow, ox, oy + (x * 75), color, font)
screen.Finish()
screen.Swapbuffers()


Any help would be appreciated.
0 Kudos
2 REPLIES 2
RokuJoel
Binge Watcher

Re: Problem rendering font on newer rokus

can you create an example .zip we can side-load, including the font, which demonstrates the issue and PM it to me via DropBox or other file transfer mechanism?

Thanks

- Joel
0 Kudos
NewManLiving
Visitor

Re: Problem rendering font on newer rokus

Some things to consider

1 make sure you have a valid font: font <> Invalid
an invalid value passed to the drawing function will not result in an error, it just will not print anything. At least on roku3
So test your font return value to ensure it is of type roFont

2. Make sure your x, y calculations in drawtext are correct and are not drawing off screen

3. You do not need to call Finish. SwapBuffers calls it for you
My Channels: 2D API Framework Presentation: https://owner.roku.com/add/2M9LCVC
Updated: 11-11-2015 - Completed Keyboard interface
The Joel Channel ( Final Beta )
0 Kudos
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.