How do I measure character width?

Victor Eijkhout eijkhout at cs.utk.edu
Thu Mar 6 17:48:01 EST 2003


I want to put some characters in a field, equally spaced horizontally 
and vertically. Meaning, my lines are "A  B  C  D" etc, and want the 
vertical distance between lines the same as the horizontal distance 
between A and B. I'm using a monospaced font.

I've found the textHeight parameter. Now how do I measure the width 
of a string such as "A  " so that I can set the text height to that?
-- 
Victor Eijkhout <eijkhout at cs.utk.edu>
tel: 865 974 9308 (W), 865 673 6998 (H), 865 974 8296 (F)
http://www.cs.utk.edu/~eijkhout/



More information about the use-livecode mailing list