[comp.sys.amiga.tech] Fonts on window

brianm@sco.COM (Brian Moffet) (04/19/88)

I assume this is the correct newsgroup....

I am trying to write a program which will change the fonts on 
the console device of a CLI process.   I am doing this to learn,
so getting a binary would be little help.   I have tried the
following attempts:

Open a font
change the following Rastports with Setfont

IntuitionBase->FirstWindow->RastPort
IntuitionBase->ActiveWindow->RPort
GfxBase->DefaultFont

I have gotten the font for the title bar to change (looks strange in
emerald 12! ), but I have not been able to change the font in the
window. I tested by doing a printf after setting the fonts.

Is there an example out there?  I know someone has done this, I keep
hearing about a 'setfont' command, but I am lost right now.

Thanks much

Brian 
-- 
Brian Moffet		brianm@sco.com  {uunet,decvax!microsof}!sco!brianm
The opinions expressed are not quite clear and have no relation to my employer.
'Evil Geniuses for a Better Tommorrow!'

cmcmanis%pepper@Sun.COM (Chuck McManis) (04/21/88)

In article <458@viscous> brianm@sco.COM (Brian Moffet) writes:
>I assume this is the correct newsgroup....

none better.

>I am trying to write a program which will change the fonts on 
>the console device of a CLI process.   I am doing this to learn,
>so getting a binary would be little help.   

Your attempts were good but you are missing a critical piece of 
information. Specifically, the window that the console device is
using. There is a program that Carolyn Scheppner wrote called
ConsPackets.c that is on a Fish disk as well as on BIX and possibly
in the source archives on purdue. This program shows you how to send
a packet to the console.device and have it return a ConUnit structure
which has in it a pointer to a window. Set _that_ windows font to 
the one you want and <poof> the font will change on the console of
that CLI process. You might also want to type ^[c to clear the screen
to keep the console from being fragged by two different fonts on the
screen. 

>I have gotten the font for the title bar to change (looks strange in
>emerald 12! )

Another thing to consider is that the console device does not handle
proportional fonts very well at all. The problems occur when you 
try to 'erase' characters and such.


--Chuck McManis
uucp: {anywhere}!sun!cmcmanis   BIX: cmcmanis  ARPAnet: cmcmanis@sun.com
These opinions are my own and no one elses, but you knew that didn't you.

dillon@CORY.BERKELEY.EDU (Matt Dillon) (04/22/88)

	I believe you have to send the reset escape sequence to the console
device to force it to re-read the window's font.

				-Matt