开发者

obtain x,y coords of individual Chars in a gdi widget

if i use text开发者_如何学Pythonout("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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜