tags:

views:

21

answers:

1

if i use textout("this text") with a particular font/style, i want to find out the (x,y) coords of 't' 'h' 'i' 's' chars. i cant use the printer route. how else can i obtain the individual x,y coords.

A: 

For non-complex scripts, you can use GetCharacterPlacement(). It's a GDI function that'll tell you the positions of each glyph in the string. This will work for western languages.

If you need to handle complex scripts (right-to-left languages, writing systems where the glyphs change shape depending on context), you'll need to use Uniscribe. It can get pretty complicated.

Adrian McCarthy