Currently, Roku is only set up to display single-byte western European characters. For multibyte UTF8 support, you can use the image canvas, however, there’s currently a bug that prevents it for working correctly. We expect to have that bug resolved shortly. Also, you will have to supply your own ttf or otf font file.
“RokuPatrick” wrote:
Currently, Roku is only set up to display single-byte western European characters. For multibyte UTF8 support, you can use the image canvas, however, there’s currently a bug that prevents it for working correctly. We expect to have that bug resolved shortly. Also, you will have to supply your own ttf or otf font file.
Patrick,
UTF8 support would be incredible. I’ve been using custom utf8 fonts in my applications and the it is never rendered correctly. Was it ever supposed to work (bug) – or is this a new feature? In order for image canvas to display utf8 strings, does that also mean that roXMLParser will also support utf8? From my interactions (and various inconsistencies) – it seems that the xml parser already supports non-ASCII characters to a certain degree. I noticed that I could get certain special characters (like copyright) to display on the poster screens, etc. – but not on other screens (search, image canvas, etc.).
We do not currently have official universal support for utf8 in the SDK. There are some components that support it (like strings in the manifest file and the xml parser) but it was all done on an as-needed basis with no attempt to make them universally supported.
It is on our radar to add this support, but not currently scheduled.
I found the way to show Cyrillic letters on screen. I use roImageCanvas and CP1251 font. To show russian text on e.g. roPosterScreen I show roPosterScreen, and then transparent roImageCanvas above it, where I put Russian text. Check out https://owner.roku.com/add/7ENBQ, click on any TV channel, to see the screen with russian text.
The problem here is that roImageCanvas takes all input from remote. How can I redirect input from remote to roPosterScreen which is underneath?
Or may be there is a way to put my font to roPosterScreen?
You can’t redirect output. You can implement the functionality via the message loop on your image canvas (i.e. SetFocusedListItem on Left and Right keypresses, etc.), but only the top most screen updates, so you’d have to hide and redraw the image canvas on every change. While technically it could probably be done, it’d be tedious, and the screen flicker would probably be pretty annoying for the end user.
Another option is to draw a completely custom poster screen with the image canvas component (this is what I did for my SiriusXM channel), but that’s even more tedious, and not something I’d recommend unless you’ve got a lot of patience and determination.
“TheEndless” wrote:
You can’t redirect output. You can implement the functionality via the message loop on your image canvas (i.e. SetFocusedListItem on Left and Right keypresses, etc.)
There is one problem here: if you have roPosterScreen with categories, than you can’t programatically move focus from category selection on the top to the items in the list. Even if you call SetFocusedListItem, the focus stays on top.
“TheEndless” wrote:
the screen flicker would probably be pretty annoying for the end user.
Actually the screen is not flicking. When you call show() for roPosterScreen, which is underneath roImageCanvas, it just removes the elements you have in roImageCanvas. And when you call show() for roImageCanvas, it just pains additional things above. So, it good enough for decorating standard components with some additional text/graphics.
But it looks you are right. The only way to go for me with my custom CP1251 Russian font is to paint complete screen myself. I’m going to dig into roImageCanvas possibilities and push them to the limits
“TheEndless” wrote:
You can’t redirect output. You can implement the functionality via the message loop on your image canvas (i.e. SetFocusedListItem on Left and Right keypresses, etc.)
There is one problem here: if you have roPosterScreen with categories, than you can’t programatically move focus from category selection on the top to the items in the list. Even if you call SetFocusedListItem, the focus stays on top.
Oops. You’re right. I forgot about that. :oops:
“dmitskevich” wrote:
“TheEndless” wrote:
the screen flicker would probably be pretty annoying for the end user.
Actually the screen is not flicking. When you call show() for roPosterScreen, which is underneath roImageCanvas, it just removes the elements you have in roImageCanvas. And when you call show() for roImageCanvas, it just pains additional things above. So, it good enough for decorating standard components with some additional text/graphics.
By “flicker”, I’m more referring to the split second that the wrong text and font would display as you alternate .Show()s. Is it fast enough that you’re not seeing that?
“dmitskevich” wrote:
But it looks you are right. The only way to go for me with my custom CP1251 Russian font is to paint complete screen myself. I’m going to dig into roImageCanvas possibilities and push them to the limits
As I mentioned above, I did this for my SiriusXM channel (see screenshot here: http://www.permanence.com/roku/images/s … s_main.jpg), so I have a good idea of what you’re in for. Good luck with it, and feel free to ask if you get stuck!
My Roku have got new firmware, version 2.9 build 1553. On this firmware the idea with CP1251 doesn’t work anymore! The Russian characters (they have ASCII codes above 128: http://en.wikipedia.org/wiki/Windows-1251) are rendered as small squares.
What was changed in 2.9, that CP1251 font is not rendered anymore?
The latest firmware update seems to have had no positive effect on rendering special characters or to even manage extended ASCII. That is to say, it cannot interpret characters from West European languages.
It’s not too much to ask for the capability to render the commonest languages in the Roku interface, independent of the the apps associated with a particular “channel.” It shouldn’t be a problem to render in UTF8.
It looks like it is now interpreting UTF-8 encoded strings, which is good and bad. My channel was converting UTF-8 to single bytes (greater than 127) to use with its own font and now that’s broken. It looks like if I take out my UTF-8 conversion things display properly (at least in my limited testing). It would have been nice to have gotten a heads up on this.
That’s a smart business move - only doing the bare minimum that would be required to stay in business, or to expand your market by making the bare minimum attempt.
It’s not like Roku has unlimited resources. They’d probably do better focusing on, say, Australia than Russia for expansion. It’s not possible to expand everywhere all at once. You have to take one step at a time.