WPCubed Product Support

Length of a string in accordance with the font

Hallo everyone,

There is way to get to know the length of a string in accordance with the Font Name and size?

I mean , "HELLO!" with "Courier New" font is longer than "HELLO!" with "Times New Roman".

Any help will be welcome. Thank you in advance.

#1 ♥ 0
2.7k Views 2 users read 1 min
support

Hi,

You can use the Canvas.TextWidth method for this when You first set the font.

You won't get exactle the same width used by WPTools unless you work in screenresolution (see FormatOptions)

Julian

#2 ♥ 0
This category is archived. No new posts are possible.