简体   繁体   English

如何在WinForms应用程序中使用DOS字体

[英]How to use DOS font in WinForms application

I want to use in my WinForms application a font used in .net console application. 我想在我的WinForms应用程序中使用.net控制台应用程序中使用的字体。

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. 如我所见,Lucida Console不是.NET Console应用程序中使用的字体。 So Lucida Console is not the one I want. 因此,Lucida Console不是我想要的。

Why Lucida Console is not the answer? 为什么Lucida Console没有答案? 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). 在英语os中,控制台只有两种字体:Lucida Console(它是TTF)和Terminal(终端)是位图(您不能直接使用此字体,如果要使用它必须加载vgaoem.fon)。

You can read more here . 您可以在这里阅读更多内容。 List of ttf fonts available for console located in registry: HKLM\\Software\\Microsoft\\WindowsNT\\CurrentVersion\\Console\\TrueTypeFont. 注册表中可用于控制台的ttf字体列表: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. 而且,如果您查看此注册表项,您将看到默认情况下只有一种ttf字体可用-Lucida Console。

也有快递(新)。

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. 我个人使用了一种技巧来使Consolas字体在命令提示符下运行,而Courier New字体始终是“经典”样式的字体。

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. 如果您将在Visual Studio底部弹出的窗口称为“控制台”,则可以通过从菜单中选择“工具”->“选项”并选择“环境字体和颜色”设置来找到该字体。 Select "Output View" from the drop down list and it will display the font used. 从下拉列表中选择“输出视图”,它将显示所使用的字体。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM