PDA

View Full Version : VG_MOVE_TO_ABS issue



pundiramit
06-25-2009, 07:41 PM
Hi team,

I'm using the Khronos OpenVG-1.1 Reference Implementation, on my ubuntu-8.10 machine, which uses GLUT to open a valid context.

I'm trying to draw some text(TrueType) using OpenVG APIs. I'm able to draw a single character perfectly but if I'm trying to draw a string of characters then I'm getting a trailing line whenever I'm doing a VG_MOVE_TO_ABS move to the starting point of next character. Please find the screenshot here.

http://img245.imageshack.us/img245/562/screenshot1s.jpg

Any opinion on this. What am I doing wrong here?
Thanks for your concern.

Regards
Amit Pundir

Ivo Moravec
06-26-2009, 10:53 AM
Looks to me like you're not doing a VG_CLOSE_PATH before the next VG_MOVE_TO.
When you do one character, the path closes automatically as you'd expect, but you need to add them in explicitly when stringing letters together like this.

In any event though, it's probably a better idea to render letter by letter anyways.
Making a huge monolithic path to handle an entire phrase or sentence is probably not a good idea as it complicates rendering for the driver (due to fill rules for example, the individual line segments must either be checked for intersections or sorted or some other similar operation inside the driver). Using a one path per character approach probably also saves work as various bits of rendering can be cached inside the driver and accelerated.

If you have a OpenVG 1.1 implementation, use the font library functions instead.

pundiramit
06-29-2009, 01:39 AM
Thanks Moravec.

I will try to do a letter by letter rendering next.

Thanks for your concern.
Regards
Amit Pundir