[comp.windows.x] Changing font style in xterm?

wingard@ncrcae.Columbia.NCR.COM (Steve Wingard) (10/12/89)

Here at our site, we've got a number of people that have grown accustomed
to a particular (proprietary) terminal emulator program.  We're in the process
now of migrating to xterm, and it seems that all of these people are coming
to me with the same question:  "How can I make xterm change the font it's 
using?"  Not in the sense of using "-fn <fontname>" or "XTerm*VT100.font:
<fontname>" to change the font that it's starting up in, but actually
changing the window to a new font in the midst of the session.  There's
nothing in the control sequences to accomplish this, and knowing that the
manpage for xterm says "Many of the options are resettable after xterm
starts,"   I set out to try to hack up charproc.c to see if it could be
made to work.  My initial attempt (to perform an XQueryLoadFont on the
new font and use XtSetValues on the "term" widget to change the value
of XtNfont to the new font's FontStruct information) proved ineffective.
Am I beating my head against a wall trying to modify this already-realized
widget?   If so, would the best method be to create a new "term" widget,
copy all the data from the old widget over (modifying the XtNfont falue in
the process), then realizing the new widget and destroying the old one?
(BTW, this is all using 11.2 Xt intrinsics and Xlib).  Any help would
be appreciated.


Steve Wingard                        ...{hp-sdd|ucsd}!ncr-sd!ncrcae!wingard
NCR Corp., E&M-Columbia              ...!gatech!ncrats!ncrcae!wingard
TOWER Systems Development		wingard@ncrcae.Columbia.NCR.COM 

kit@EXPO.LCS.MIT.EDU (Chris D. Peterson) (10/13/89)

> I set out to try to hack up charproc.c to see if it could be
> made to work.  My initial attempt (to perform an XQueryLoadFont on the
> new font and use XtSetValues on the "term" widget to change the value
> of XtNfont to the new font's FontStruct information) proved ineffective.

My guess is that the "term" widget needs support in its SetValues method
that will cause it to get new GCs when the font is changed.  Since Xterm
did not support this behavior in previous versions it is not surprising that
this fails.  It looks like you will need to modify the "term" widget to
get the behavior that you desire.  Good Luck, (you'll need it, that code
is ugly :-).


						Chris