示例#1
0
        public static void SetConsoleFont()
        {
            var fontInfoEx = new FontInfoEx
            {
                cbSize     = Marshal.SizeOf <FontInfoEx>(),
                FontIndex  = 0,
                FontFamily = FIXED_WIDTH_TRUE_TYPE,
                FontName   = "MS Gothic",
                FontWeight = 400,
                FontSize   = 48
            };

            var consoleOutputHandle = GetStdHandle(STD_OUTPUT_HANDLE);

            SetCurrentConsoleFontEx(consoleOutputHandle, false, ref fontInfoEx);
        }
示例#2
0
 private static extern bool SetCurrentConsoleFontEx(IntPtr hConsoleOutput, bool MaximumWindow, ref FontInfoEx ConsoleCurrentFontEx);