Archived

This topic is now archived and is closed to further replies.

RageMatrix

2D Vector Text help.

Recommended Posts

Hi all, I'm getting my head round vector graphics in 2D at the moment and trying to construct some routines to draw vector graphics text based on a normal text string to a certain XY co-ordinate. I have a line drawing function Line(x1, y1, x2, y2) which I am going to use to draw this text. I would like some advice or suggestions for ways of doing this. My first thought was to have a generic data structure for each letter made up of nine points (each with an XY co-ordinate) like this: -
1     2     3
*     *     *


4     5     6
*     *     *


7     8     9
*     *     *
 
So, for example, to draw the letter 'A', you would store the pattern like this: -
FROM   TO
7      4        2 Bytes
4      2        2 Bytes
2      6        2 Bytes
6      9        2 Bytes
4      6        2 Bytes
 
The generic data structure of these nine points (with 5 being the local origin) would be used to draw the letters only, but not stored for each letter (I think). Problem is, I'm not really sure where to go from here. What data structures could I use for this? Arrays? Any ideas on how to implement this? Is it too complicated or is there an easier way? Thank you for any advice. RM. Tron Software [edited by - RageMatrix on October 16, 2003 4:56:15 PM]

Share this post


Link to post
Share on other sites