David wrote:
> Luke Bradshaw wrote:
>> Hi,
>> i'm writing an application that runs in the console, does anyone know if
>> there are any functions for changing the font/colours in the console
>> display?
> Not in the C language itself. They are separate libraries (ncurses is
> one) that exist for doing this.
In any case, I _doubt_ you'll be able to change the font unless you
specifically interact with whatever xterm or tty your code is running on.
I could be wrong, but changing the font the text displays with is beyond
the scope of most console stuff. You print to standard out, and the
terminal deals with putting it on the screen. You could go to hardware and
force a video mode change, maybe, or you could interact with Konsole or
something, but there's no simple way to just change the on-screen font from
a console app.
For colors, everything there is terminal dependant as well. You can do it
with ANSI color codes, but they will look bad on a terminal that can't
display them. You'd need to read the TERM environment variable and format
your output accordingly. Probably the easy thing to do here is play with
some libary that already takes care of details like this, and just print
out using the library's print function.
I haven't played here. I'm sort of combining my user side knowledge of how
Linux stuff works with my DOS knowledge of console programming. The
hardware is the same though, and I can say there's not much you can do from
a DOS program to change the on-screen font without going into the hardware,
and even then the choice is limited. Linux can't be that different, though
getty or whatever may already know how to get into the hardware, and that
whole framebuffer concept has potential I haven't even really considered.
I suppose you _could_ change the font used on the framebuffer, but I've
never seen a console Linux program that did that...
--
Michael McIntyre zone 6b in SW VA
Silvan Pagan
umount /mnt/windows;mke2fs /dev/hde1;tune2fs -j /dev/hde1
www.geocities.com/Paris/Rue/5407/index.html