2

According to this article https://en.wikipedia.org/wiki/Monospaced_font I tried to use Courier, Courier New, Lucida Console, Monaco, and Consolas. Why I find only "Courier New" and "Consolas" are actually monospaced and hence support fixed width of letters so I can align my multiple lines of text well? My text looks like this: ABC 111 ABXa 22222222 Haaaih 3333 uiu asx

Where I can find a full list of fonts which support fixed width letters in C#? Thanks!

spspli
  • 3,128
  • 11
  • 48
  • 75
  • I don't think its specific to C#. Any system installed monospaced font will do. – wingerse Oct 01 '15 at 17:03
  • But why use Lucida Console as the font of my text label in C#, it doesn't display letters in a fixed width way? – spspli Oct 01 '15 at 17:08
  • I agree that monospaced fonts is not specific to C#. But my question is why some monospaced fonts like Lucida Console doesn't display fixed width for each letter in C#? – spspli Oct 02 '15 at 14:10
  • Sorry, not aware that we cannot ask for the reference materials in this site. I use the Consolas anyway and it supports the fixed width. You can help close the question. Thanks all the same! – spspli Oct 08 '15 at 19:28

1 Answers1

1

A hack you may want to consider would be to query the width of various characters using the given font. For example, if 'W', 'i', 'O', and 'l' are all the same width, then you are probably dealing with a fixed width font.

Community
  • 1
  • 1
Parappa
  • 7,566
  • 3
  • 34
  • 38
  • 1
    So do we have any documents telling us the whole list of all available monospaced fonts in C#? Or any documents/code explaining why Monaco, or Lucida Console etc. doesn't display with fixed width letters in C#? – spspli Oct 02 '15 at 14:09