ciack404
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2016
07:32 AM
Whitespace character
Hi,
I am trying to show a whitespace character in a custom keyboard, using the default fonts
While this code works for symbols like @, %, :, ;... it doesn't for ␣
What is involved in order to show that symbol? Should I add it to a custom font or are there other (better) solutions?
Thanks.
I am trying to show a whitespace character in a custom keyboard, using the default fonts
...
fontInstance = createobject("rofontregistry")
useFont = fontInstance.GetDefaultFont()
...
roScreen.drawText("␣", someX, someY, useFont)
While this code works for symbols like @, %, :, ;... it doesn't for ␣
What is involved in order to show that symbol? Should I add it to a custom font or are there other (better) solutions?
Thanks.
4 REPLIES 4
belltown
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2016
09:58 AM
Re: Whitespace character
What character are you using? Have you tried the non-breaking space: http://www.fileformat.info/info/unicode/char/00a0/index.htm?

RokuMarkn
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2016
11:34 AM
Re: Whitespace character
It looks like you're using U+2423 (OPEN BOX). This character is not in the default font. So you can either use your own font which contains this character, or choose a different character which is in the default font, like _ (underscore).
--Mark
--Mark
ciack404
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2016
06:14 AM
Re: Whitespace character
Thanks for the replies.
I added the character to a custom font, but I still can't see it displayed using .drawText(. How should I reference the new character in my code? Is there an example I can follow? I searched but can't find anything.
I tried:
but I still can't see anything.
I'm using this font: http://www.fontex.org/download/inconsolata.otf (according to this website it has the open box character http://www.fileformat.info/info/unicode ... upport.htm)
"RokuMarkn" wrote:
It looks like you're using U+2423 (OPEN BOX). This character is not in the default font. So you can either use your own font which contains this character, or choose a different character which is in the default font, like _ (underscore).
--Mark
I added the character to a custom font, but I still can't see it displayed using .drawText(. How should I reference the new character in my code? Is there an example I can follow? I searched but can't find anything.
I tried:
roScreen.drawText("␣", someX, someY, useFont)
ba = CreateObject("roByteArray")
ba.FromHexString("e290a3")
renderedText = ba.ToAsciiString()
roScreen.drawText(renderedText, someX, someY, useFont)
renderedText = Chr(&H2423)
roScreen.drawText(renderedText, someX, someY, useFont)
but I still can't see anything.
I'm using this font: http://www.fontex.org/download/inconsolata.otf (according to this website it has the open box character http://www.fileformat.info/info/unicode ... upport.htm)
ciack404
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2016
07:23 AM
Re: Whitespace character
Ok solved.
I was using GetFont() in a wrong way.
Thanks for the help.
I was using GetFont() in a wrong way.
Thanks for the help.