C#, WPF. Length of string that will fit in a specific width.
- by Ian
Hi,
I'm sure I'm missing something obvious, I have an area in which I intend to draw text. I know its (the area) height and width. I wish to know how many characters/Words will fit in the width, characters preferably. Second question, If the line is too long I'll want to draw a second line, so I guess I need to get the height of the text as well, including what ever it considers the right vertical padding?
I'd also rather like to know the inverse, i.e. how many characters I can fit in a specific width.
I assume the fact that WPF isn't constrained to pixels will have some bearing on the answer?
Ultimately I'm planning on wrapping text around irregular shaped images embedded in the text.
Any pointers in the right direction would be great.
Thanks