I'm trying to create coloumns of text for a C# app that will be running on MSN Messenger. I'm having trouple getting everything to line up.
Here's an example of the output that I want:
1) Pizza Hut 123 Fake St.
2) Domino's Pizza 123 Fake St.
3) The Cheesecake Cafe 123 Fake St.
4) Capital Pizza & Steakhouse 123 Fake St.
5) Funky Pickle Pizza 123 Fake St.
6) Boston Pizza 123 Fake St.
7) Rose Bowl Rouge Lounge 123 Fake St.
8) Royal Pizza 123 Fake St.
9) A Columbus Pizza & Donair Inc 123 Fake St.
But because it is a variable width font it is displaying like this:
1) Pizza Hut 123 Fake St.
2) Domino's Pizza 123 Fake St.
3) The Cheesecake Cafe 123 Fake St.
4) Capital Pizza & Steakhouse 123 Fake St.
5) Funky Pickle Pizza 123 Fake St.
6) Boston Pizza 123 Fake St.
7) Rose Bowl Rouge Lounge 123 Fake St.
8) Royal Pizza 123 Fake St.
9) A Columbus Pizza & Donair Inc 123 Fake St.
I have tried using the C# string.PadRight() function as well as creating my own function that add padding using spaces and tabs. Both work fine with fixed width fonts but break with variable width fonts.
Is there any way to determine the width of a string in a given font?
Or does anyone have any other suggestions?