Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

character spacing on a canvas

Status
Not open for further replies.

cppdev

Programmer
May 12, 2003
23
US
I am writing text directly to a canvas.
I set the font (courier since it is fixed width by definition) and need to know how to find or calculate the space between the characters.

My goal is to calculate the location of each possible character on this canvas....i know how to find the character height and width and need to know how to find the spacing between characters.

Thanks in advance.

cppdev
 
If you are using the font courier you can some of his features.
First, ever char of this font has the same size, I mean, the letter "i" has the same width for width and height than a letter "m".
So you can do some measures writting texts like
"a", check the width and then
write "am", check the width, substract 2 times the first and thats the width for the spacing betwen characters.





---LastCyborg---
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top