views:

381

answers:

3

I want to use in my WinForms application a font used in .net console application.

What font do I need to use?

Lucida Console is not the font that is being used in .NET Console application as I see it. So Lucida Console is not the one I want.

+4  A: 

Why Lucida Console is not the answer? Because it is. In english os, there is only two fonts for console: Lucida Console which is TTF, and Terminal which is bitmap (You cannot use this font directly, you must load vgaoem.fon if you want to use it).

You can read more here. List of ttf fonts available for console located in registry: HKLM\Software\Microsoft\WindowsNT\CurrentVersion\Console\TrueTypeFont. You can read about requirement for such fonts in the KB article.

And if you look into this registry key, you will see that by default there is only one ttf font available - Lucida Console.

arbiter
I run my .NET Console App and I see that font being used is not Lucida. Lucida does not look cool enough.
So how would one load vgaoem.fon and use it? (+1 for your answer anyway)
Patrick McDonald
Gdi+ does not support bitmap fonts, only ttf. So if you want use such fonts you need to via system interop (look at CreateFont win32 function).
arbiter
A: 

There is also Courier (New).

Coding With Style
A: 

It appears that your console/command prompt font may have been changed. Try doing this:

Open the command prompt. Right click the icon in the top left of the window and select "Properties". In the properties window, click the "Font" tab. You'll see a list of potential fonts there, as well as the one that was selected.

I personally used a hack to get the Consolas font working on my command prompt, and the Courier New font is always a "classic" style font.

If you're referring to the window that pops up at the bottom of Visual Studio as your "console", you can find that font by selecting Tools->Options from the menu and selecting the "Environment Fonts and Colors" settings. Select "Output View" from the drop down list and it will display the font used.

Dillie-O
Courier New is cool and all. But what I want is to simply have an app that looks like a console app with little extra effects. So I made a user control that uses a textbox with font set to (Lucida Console) for now, but it is different from "command prompt" window font (which is set to Raster Fonts 8x12, which is what I want).