which font has same width?

  • Thread starter Thread starter kathy
  • Start date Start date
K

kathy

I want to alignment the text output. Some font(arial,
Time New Roman, etc.) characters do not have the same
width. Could anyone tell me which font has same width?

Thanks.
 
Kathy,

I thought that the character blank was in all fonts equal.

But take a look at "graphics measurestring" in/on MSDN, I think that will
help you better than my message above

Cor
 
kathy said:
I want to alignment the text output. Some font(arial,
Time New Roman, etc.) characters do not have the same
width. Could anyone tell me which font has same width?

Kathy: The days of fixed-width fonts generally ended with DOS (and
dot-matrix printers.) There still are some available but they aren't used
in Windows very much... most of the fonts are proportionally spaced.
 
kathy said:
I want to alignment the text output. Some font(arial,
Time New Roman, etc.) characters do not have the same
width. Could anyone tell me which font has same width?

Courier New
 
Herfried K. Wagner said:
Do you use a fixed-width font in your VS.NET code editor? Most code
editors use fixed-width fonts, many newsreaders too.

I use whatever font is the default. Perhaps I don't understand your
question.
 
Herfried K. Wagner said:
You said:

<quote
There still are some available but they aren't used
in Windows very much...
</quote>

Okay... I didn't count on Visual Studio's editor and many newsreaders. I'd
guess most to all newsreaders if you don't choose HTML format however.
Text-based e-mail also.
My message was not criticism, I only wanted to add that the use of fixed-width
fonts still makes sense in some cases.

It makes a lot of sense in some cases. What font do you normally use on
your VB.Net forms? I didn't think the original poster was having trouble
lining up the code in her editor. But of course I could be wrong.

<quote
There still are some available but they aren't used
in Windows <insert applications insert /> very much...
</quote>
 
* "Tom Leylan said:
Okay... I didn't count on Visual Studio's editor and many newsreaders. I'd
guess most to all newsreaders if you don't choose HTML format however.
Text-based e-mail also.

You were right -- VS.NET is not part of Windows.

:-)
It makes a lot of sense in some cases. What font do you normally use on
your VB.Net forms? I didn't think the original poster was having trouble
lining up the code in her editor. But of course I could be wrong.

It depends on the type of application the OP wants to build. It
depends, on what he/she wants to implement. If it should be a little
text editor like notepad (for learning purposes), a fixed-width font for
the editor would be nice (+ the option to choose the font).
<quote
There still are some available but they aren't used
in Windows <insert applications insert /> very much...
</quote>

;-)

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>

<http://www.plig.net/nnq/nquote.html>
 
Herfried K. Wagner said:
It depends on the type of application the OP wants to build. It
depends, on what he/she wants to implement. If it should be a little
text editor like notepad (for learning purposes), a fixed-width font for
the editor would be nice (+ the option to choose the font).

I see now she was asking about "text output" I missed that part. Seems like
it might be for a report.
 
Kathy,
If you want to avoid hard coding the font name to the ones that Armin, Rick,
& Herfried listed, you can use the FontFamily.GenericMonospace property to
the Font constructor.

Dim myFont as New Font(FontFamily.GenericMonospace, 12)

Will create a 12 point Courier New font on most systems, on systems where
Courier New is not installed it will select a different fixed width font. Or
fail if there are no fixed width fonts.

You can also use FontFamily.GenericSansSerif & FontFamily.GenericSerif to
avoid hard coding Arial & Times New Roman fonts.

Hope this helps
Jay
 
FontFamily.GenericMonospace property to
the Font constructor.

Dim myFont as New Font(FontFamily.GenericMonospace,
12)

This is a great answer. Consider it in my bag of
tricks. :)

Thanks Jay,
Joe
~ Waiting and hoping the 3 day turnaround is true. The
14th is day 4... MS touts this, I'm waiting to see for
myself.
 
Back
Top