sonnykr
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2015
09:08 AM
Font rendering not smooth on 2DAPI
Hi All,
I am rendering a custom font on both roCompositor and roImageCanvas. The text appears to be very smooth on imagecanvas, however, the text rendered using 2D is very sharp and jagged. Is there a way to make it smooth? I tried
But this doesn't make a noticeable difference on how it renders.

Could you suggest a way to render fonts smooth using 2DAPI?
Thanks!
I am rendering a custom font on both roCompositor and roImageCanvas. The text appears to be very smooth on imagecanvas, however, the text rendered using 2D is very sharp and jagged. Is there a way to make it smooth? I tried
mode = 1
ifRegion.SetScaleMode(mode)
But this doesn't make a noticeable difference on how it renders.

Could you suggest a way to render fonts smooth using 2DAPI?
Thanks!
2 REPLIES 2

NewManLiving
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2015
09:17 AM
Re: Font rendering not smooth on 2DAPI
You may want to check this out to see if it can help:
http://forums.roku.com/viewtopic.php?f=34&t=73840&p=455654&hilit=font#p455654
http://forums.roku.com/viewtopic.php?f=34&t=73840&p=455654&hilit=font#p455654
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 )
belltown
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2015
09:43 AM
Re: Font rendering not smooth on 2DAPI
If you're calling SetScaleMode on the region you're rendering the text to (destination region), it won't do anything; it has to be called on the source region.
Draw the text on a bitmap, unscaled (use ifFont.GetOneLineHeight () and ifFont.GetOneLineWidth () to calculate its size). Create a region that maps onto that bitmap. Then call SetScaleMode (1) on that region (source region) before calling DrawScaledObject to get the text from that region to your destination region.
Draw the text on a bitmap, unscaled (use ifFont.GetOneLineHeight () and ifFont.GetOneLineWidth () to calculate its size). Create a region that maps onto that bitmap. Then call SetScaleMode (1) on that region (source region) before calling DrawScaledObject to get the text from that region to your destination region.