开发者

C# console font

I cannot find out which font the console app uses by default? Is it guaranteed that everyone has that font (when running this .NET app)? Want to dis开发者_StackOverflowplay some unicode chars and need to be sure they are present within that font. Thanks


I strongly recommend avoiding the Console if you want to use Unicode characters. There are many issues with trying to get the Console to display Unicode correctly.

Unicode is not directly supported in Console output. The best option is typically to set the console's code page, which will require P/Invoke.

That being said, a GUI solves all of these issues, in a much nicer fashion. If you need Unicode output, I'd recommend a simple GUI.


You can tell what font is being used by reading the registry value "0" from this key:

HKLM\Software\Microsoft\Windows NT\CurrentVersion\Console\TrueTypeFont
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜