Width of string character in pixels

  • Thread starter Thread starter Sal
  • Start date Start date
S

Sal

Does anybody know how to get the width of a string character like 'W' in
pixels?
Any help would be greatly appreciated.

Sal
 
Sal said:
Does anybody know how to get the width of a string character like 'W' in
pixels?
Any help would be greatly appreciated.

Stephen Lebans knows how. ;-)

Check his web site at www.lebans.com

I would start with his TextHeightWidth function.
 
Does anybody know how to get the width of a string character like 'W' in
pixels?

In... which font? Comic Sans Bold 48 point will have a lot more pixels
than Arial Narrow 6 point... and for that matter, even with a
consistant font the number of pixels will depend on the user's screen
settings and even their monitor hardware.

What exactly are you trying to accomplish?
 
John,
I am creating an email format to send confirmation for Orders that customers
make. I would like it to be formatted like a sales order showing Items sold
as follows

Qty Item Unit Extended

I have written a function that based on number of columns (in this case
four) and length of my entries from database aligns the columns. I give a
column width for each column and if for example Item description is smaller
than column width I would like to pad it so the next column is aligned.
Using spaces does not work so I want to go with the widest Character for
example (W) to achieve this.
Any suggestions? Any better way that you can think of?

Thanks,
Sal
 
I am creating an email format

.... which means that you have absolutely NO control over the width,
since you have no way of predicting what font the recipient of the
email will use to display their message!

This sounds like a really tough one, and no, I fear I have no
suggestions other than to follow the link posted elsewhere in this
thread.
 
Back
Top