scorpiontahir02
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-24-2013
03:32 AM
How to find number of characters to print on one line
How can we find that how many characters of specific string we can print on a single line without wrapping in roImageCanvas? I am getting strings of news feeds from online source and want to print it in just one line and discard extra chracters.
I have looked into documentation of font and font registry but could not find a solution.
Thanks in advance...
I have looked into documentation of font and font registry but could not find a solution.
Thanks in advance...
2 REPLIES 2

NewManLiving
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-24-2013
06:33 AM
Re: How to find number of characters to print on one line
Have not tried this but you probably can create a rofontregistry and call its methods to return a default font
To your liking (you do not have to call register for the default font just call the default methods)
And use this font handle as your guide. You would then create the string representation
Of the template font for use in your canvas by calling get with the same font
Description. Use your font handles getonelinewidth to get the information you need
And adjust your string before sending it off to the canvas with the string representation
Of the same font
To your liking (you do not have to call register for the default font just call the default methods)
And use this font handle as your guide. You would then create the string representation
Of the template font for use in your canvas by calling get with the same font
Description. Use your font handles getonelinewidth to get the information you need
And adjust your string before sending it off to the canvas with the string representation
Of the same font
My Channels: 2D API Framework Presentation: https://owner.roku.com/add/2M9LCVC
Updated: 11-11-2015 - Completed Keyboard interface
The Joel Channel ( Final Beta )
Updated: 11-11-2015 - Completed Keyboard interface
The Joel Channel ( Final Beta )

RokuJoel
Binge Watcher
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-24-2013
07:16 PM
Re: How to find number of characters to print on one line
I would imagine that using ifFont.getoneLineWidth would be accurate for imageCanvas as well as roScreen.
- Joel
- Joel