I actually had to do this once. Don't know if it works on Vista.
Code:
#define _WIN32_WINNT 0x0500 // for GetConsoleFontSize(), XP and up
#include <windows.h>
#include <iostream>
using namespace std;
//------------------------------------------------------------------------------
struct CONSOLE_FONT
{
DWORD index;
COORD dim;
};//CONSOLE_FONT
BOOL (WINAPI *SetConsoleFont)(HANDLE, DWORD);
BOOL (WINAPI *GetConsoleFontInfo)(HANDLE, BOOL, DWORD, CONSOLE_FONT*);
DWORD (WINAPI *GetNumberOfConsoleFonts)();
//------------------------------------------------------------------------------
template<typename pfn_t>
inline bool LoadFunc(HMODULE hmod, const char *name, pfn_t &fn)
{
fn = (pfn_t)GetProcAddress(hmod, name);
return fn != 0;
}//LoadFunc
//------------------------------------------------------------------------------
int main()
{
char title[MAX_PATH];
HWND hwnd;
if (!::GetConsoleTitleA(title, sizeof(title)) ||
!(hwnd = ::FindWindowA(0, title)))
{
cerr << "Failed to find console window" << endl;
return 1;
}//else
// Undocumented API's
HMODULE hmod = ::GetModuleHandleA("KERNEL32.DLL");
if (!hmod ||
!LoadFunc(hmod, "SetConsoleFont", SetConsoleFont) ||
!LoadFunc(hmod, "GetConsoleFontInfo", GetConsoleFontInfo) ||
!LoadFunc(hmod, "GetNumberOfConsoleFonts", GetNumberOfConsoleFonts))
{
cerr << "Failed to load API(s): " << ::GetLastError() << endl;
return 1;
}//if
HANDLE hOut = ::GetStdHandle(STD_OUTPUT_HANDLE);
// number of console fonts
const DWORD MAX_FONTS = 40;
DWORD num_fonts = GetNumberOfConsoleFonts();
if (num_fonts > MAX_FONTS)
num_fonts = MAX_FONTS;
CONSOLE_FONT fonts[MAX_FONTS] = {0};
GetConsoleFontInfo(hOut, 0, num_fonts, fonts);
for (DWORD n = 0; n < num_fonts; ++n)
{
fonts[n].dim = GetConsoleFontSize(hOut, fonts[n].index);
if (fonts[n].dim.X == 6 &&
fonts[n].dim.Y == 8)
{
SetConsoleFont(hOut, fonts[n].index);
::InvalidateRect(hwnd, 0, FALSE);
::UpdateWindow(hwnd);
return 0;
}//if
}//if
cerr << "Didn't find font" << endl;
return 1;
}//main
gg