Hi guys,
Could someone give me an example how to use Cyrillic (or different language) on roImageCanvas?
Here is what I have tried and it didn't work:
textUtl=createObject("roUrlTransfer")
textUtl.SetUrl("http:// -this brings me an xml with body containing cyrillic- ")
textUtl.GetToFile("tmp:/text.xml")
xml= CreateObject("roXMLElement")
xml.Parse(ReadAsciiFile("tmp:/text.xml"))
text=xml.GetNamedElements("body").getText()
fontReg = CreateObject("roFontRegistry")
fontReg.Register("pkg:/fonts/OpenSans.ttf")
font = fontReg.Get("OpenSans",20,40,false)
Textbox = {TargetRect:{x:int((width/2)-(boxW/2)),y:130,w:boxW,h:boxH}, text:text, TextAttrs:{Font:font, HAlign:"Justify", VAlign:"Top" }}
canvas.SetLayer(2, textBox)
The text prints on the console as various symbols
BrightScript Debugger> ? xml.GetNamedElements("body").getText()
’ ¶ µ ´ ° ² ½ ¾ ² – ´ ¾ ¼ ¾, ‰ ¾ ‡ ¸ ‚ ° ± µ » Œ ½ � ² ¸ º ¾ € ¸ � ‚ ° ½ ½ � Lorem Ipsum ¿ ¾ » � ³ ° ” µ º � ‚." ¦ µ € ¾ ± ¸ ‚
I have also tried Webdings font (which is all icons) and it displays as squares.
Any ideas why its not working?
Thanks,
Gary