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: 
Highlighted
dmitskevich
Level 7

Russian (Cyrillic) letters

Dear Roku developers and community,

is it possible to display Cyrillic text somewhere in Roku components?

As far as I tested:

1) XML parser (roXMLElement) doesn't return unicode characters
2) Poster Screen (roPosterScreen) doesn't display unicode characters
3) Springboard Screen (roSpringboardScreen) doesn't display unicode characters

The code I used to verify e.g. Springboard Screen is:


Function Main()
port = CreateObject("roMessagePort")

springBoard = CreateObject("roSpringboardScreen")
springBoard.SetBreadcrumbText("[location 1]", "[location2]")
springBoard.SetMessagePort(port)

o = CreateObject("roAssociativeArray")
o.ContentType = "episode"
o.Title = "[Title]"+chr(1040)+"<"
o.ShortDescriptionLine1 = "[ShortDescriptionLine1]"+chr(1040)+"<"
o.ShortDescriptionLine2 = "[ShortDescriptionLine2]"+chr(1040)+"<"

o.Description = ""+chr(1040)+"<"
for i = 1 to 15
o.Description = o.Description + "[Description] "
end for

o.SDPosterUrl = ""
o.HDPosterUrl = ""
o.Rating = "NR"
o.StarRating = "75"
o.ReleaseDate = "[mm/dd/yyyy]"+chr(1040)+"<"
o.Length = 5400

o.Categories = CreateObject("roArray", 10, true)
o.Categories.Push("[Category1]"+chr(1040)+"<")
o.Categories.Push("[Category2]"+chr(1040)+"<")
o.Categories.Push("[Category3]"+chr(1040)+"<")

o.Actors = CreateObject("roArray", 10, true)
o.Actors.Push("[Actor1]"+chr(1040)+"<")
o.Actors.Push("[Actor2]"+chr(1040)+"<")
o.Actors.Push("[Actor3]"+chr(1040)+"<")

o.Director = "[Director]"+chr(1040)+"<"

springBoard.SetContent(o)
springBoard.Show()

while true
msg = wait(0, port)
if msg.isScreenClosed() then
return -1
elseif msg.isButtonPressed()
print "msg: "; msg.GetMessage(); "idx: "; msg.GetIndex()
endif
end while

End Function


where "+chr(1040)+" is letter "А" in Cyrillic alphabet: http://en.wikipedia.org/wiki/%D0%90

Is any chance/way to show Russian text in Roku?

Regards,
Dmitry
0 Kudos
33 Replies
Anonymous
Level 8

Re: Russian (Cyrillic) letters

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.
0 Kudos
retrotom
Level 7

Re: Russian (Cyrillic) letters

"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.).

Thanks,
RT
0 Kudos
RokuKevin
Level 7

Re: Russian (Cyrillic) letters

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.

--Kevin
0 Kudos
dmitskevich
Level 7

Re: Russian (Cyrillic) letters

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?
0 Kudos
jbrave
Level 7

Re: Russian (Cyrillic) letters

"dmitskevich" wrote:
How can I redirect input from remote to roPosterScreen which is underneath?


I've wondered myself if this is possible, but haven't figured out a way to do it.

Anyone?

- Joel
Screenshades: The first Screensaver for Roku2!
Musiclouds: The best free internet music, on your Roku!
Ouroborialis: Psychedelic Screensaver for Roku!
0 Kudos
TheEndless
Level 7

Re: Russian (Cyrillic) letters

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.
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
0 Kudos
dmitskevich
Level 7

Re: Russian (Cyrillic) letters

"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 Smiley Happy
0 Kudos
TheEndless
Level 7

Re: Russian (Cyrillic) letters

"dmitskevich" wrote:
"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. Smiley Surprisedops:

"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 Smiley Happy

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. Smiley Wink Good luck with it, and feel free to ask if you get stuck!
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
0 Kudos
dmitskevich
Level 7

Re: Russian (Cyrillic) letters

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