At least for xterm you can change the current font by printing an escape sequence. Syntax ESCAPE ] 50 ; FONTNAME BEL ESCAPE ] 50 ; FONTNAME BEL .
Here (shortened version) a script I use for this; I call it xfont (the real one has more errors):
I do not know what other terminal emulators recognize this sequence. In particular, I found that it does not work under screen , even if the screen session is in the xterm window.
Please note that you must specify the font name ( "10x20" , "9x15" ), not its size.
EDIT: I have to pay more attention to methods. In C ++, it will be something like:
std::cout << "\x1b]50;" << font_name << "\a" << std::flush;
Keith thompson
source share