[unix-pc.general] Changing fonts

gst@gnosys.UUCP (Gary S. Trujillo) (09/09/88)

In article <631@bacchus.UUCP> darren@bacchus.UUCP (Darren Friedlein) writes:
> ...My favorite use it to log in to one
> wondow, set font slot 0 to my moria font (220x70?), go into another window,
> start playing moria and dump the map on the previous screen so I can see the
> whole thing.  Rather obscure use, but it's nice...
> ...
> I don't like Office (UA) becuase the windows are big and clumsy, it takes up
> lots of memory, slows the system to a screaching halt (I only have 1meg now),
> and is in general a poor user interface.  [oh no, now I've done it, millions
> of UA fans after me :-].

Well, all this talk of changing fonts caused me to go back and RTFM a bit and
try a few experiments.  Though I did play with fonts one time, the thought of
having to go through all that UA nonsense (I'm hardly a UA fan) dissuaded me
from pursuing the matter too far.

What I finally came up with was a few ksh aliases which allow one to change
fonts from the current window - rather than having to do so from a different
window or to fire up UA just for this one purpose:

	alias sffi='setf 0;setf /usr/lib/wfont/FANCY.I.E.12.A 0'
	alias sffr='setf 0;setf /usr/lib/wfont/FANCY.R.E.12.A 0'
	alias sfpi='setf 0;setf /usr/lib/wfont/PLAIN.I.E.12.A 0'
	alias sfpr='setf 0;setf /usr/lib/wfont/PLAIN.R.E.12.A 0'
	alias sfs='setf 0;setf /usr/lib/wfont/system.8.ft 0'
	alias sfsr='setf 0;setf /usr/lib/wfont/system.r.8.ft 0'

(You'll have to look very closely to see the differences between the default
system font and the plain Roman font - I think most characters in these two
sets are actually identical.)

Now if someone could only explain to me how I can get to a font loaded into
slots 1-7 once they're loaded and/or the reason for the cautionary note on
p. 4-60 of the Owner's Manual about using only slot zero, after just telling
us that we have eight slots which may be used for new windows...

Jim Rosenberg / Norman Yarvin are you out there??

-- 
Gary S. Trujillo			      {linus,bbn,m2c}!spdcc!gnosys!gst
Somerville, Massachusetts		     {icus,ima,stech,wjh12}!gnosys!gst

darren@bacchus.UUCP (Darren Friedlein) (09/09/88)

In article <62@gnosys.UUCP> gst@gnosys.UUCP (Gary S. Trujillo) writes:
>...
>Now if someone could only explain to me how I can get to a font loaded into
>slots 1-7 once they're loaded and/or the reason for the cautionary note on
>p. 4-60 of the Owner's Manual about using only slot zero, after just telling
>us that we have eight slots which may be used for new windows...
>
>-- 
>Gary S. Trujillo			      {linus,bbn,m2c}!spdcc!gnosys!gst
>Somerville, Massachusetts		     {icus,ima,stech,wjh12}!gnosys!gst


Shift In and Shift Out (SI and SO) switch between slots 0 and 1.  The codes
are ^N and ^O, but I forget which does what.  To switch to the rest of them,
you can use an escape sequence of some sort.  All this is shown in the table
in escape(7) in the SysAdmin's manual.

It's also possible to switch them within a program using ioctl() calls, but
this doesn't look like what you're looking for, so I won't go into that.

-darren
         ____
        /    \
       |                                 Rt 4, Box 416, Durham, NC 27703
  _____|_____     Darren G. Friedlein      data (bacchus) : 919/596-7746
 /     |     \                                      voice : 919/596-9492
(      |      )
 \____/    __/   {mcnc|icus|ditka|ethos|gladys|bakerst}!bacchus!darren

jr@amanue.UUCP (Jim Rosenberg) (09/14/88)

In article <62@gnosys.UUCP> gst@gnosys.UUCP (Gary S. Trujillo) writes:
>What I finally came up with was a few ksh aliases which allow one to change
>fonts from the current window - rather than having to do so from a different
>window or to fire up UA just for this one purpose:
>
>	alias sffi='setf 0;setf /usr/lib/wfont/FANCY.I.E.12.A 0'
>	alias sffr='setf 0;setf /usr/lib/wfont/FANCY.R.E.12.A 0'
>	alias sfpi='setf 0;setf /usr/lib/wfont/PLAIN.I.E.12.A 0'
>	alias sfpr='setf 0;setf /usr/lib/wfont/PLAIN.R.E.12.A 0'
>	alias sfs='setf 0;setf /usr/lib/wfont/system.8.ft 0'
>	alias sfsr='setf 0;setf /usr/lib/wfont/system.r.8.ft 0'
>
>Now if someone could only explain to me how I can get to a font loaded into
>slots 1-7 once they're loaded and/or the reason for the cautionary note on
>p. 4-60 of the Owner's Manual about using only slot zero, after just telling
>us that we have eight slots which may be used for new windows...

That final number is the slot number.  To load FANCY.R.E.12.A into slot 1 just
use:

setf /usr/lib/wfont/FANCY.R.E.12.A 1

The setf 0 commands are not needed.  That clears the slot; you'd only need to
do this if you were *unloading* a slot and not loading something else back in
there.

I haven't the foggiest why they tell you not to put certain fonts into slot 0.
I've booted for months with an 8x9 font in slot 0.  It works just fine!  Here
is what I have in /etc/.fontload:

sfont -s /usr/lib/wfont/8x9 0
# sfont -s /usr/lib/wfont/PLAIN.R.E.12.A 0
# sfont -s /usr/lib/wfont/FANCY.R.E.12.A 2

This loads the 8x9 font into slot 0.  You want to be somewhat careful about
slot 1, actually, rather than slot 0.  As mentioned, SI and SO switch you
between these two slots.  It's amazing how easy it is to have this happen from
modem garbage.  Put a font into slot 1 that you wouldn't mind suddenly staring
at if you use a communications program.
-- 
 Jim Rosenberg
     CIS: 71515,124                         decvax!idis! \
     WELL: jer                                   allegra! ---- pitt!amanue!jr
     BIX: jrosenberg                  uunet!cmcl2!cadre! /

tkacik@rphroy.UUCP (Tom Tkacik) (06/16/89)

In article <WJC.89Jun15175839@ho5cad.ho5cad.ATT.COM> wjc@ho5cad.ATT.COM (Bill Carpenter) writes:
>
>Over the last couple of years, I've done considerable puttering around
>with different fonts in different windows, running different fonts as
>the "global" font, etc.  While it all seems to basically work, there
>appear to be a few rough edges left in the font handling code in the
>window driver.
>
>For example, I used to run an italic 9x12 font as the "global" font.

I haved tried changing fonts, with little luck.
I tried both setf and sfont, and once even got a new font to show up in
the current window.  The problem (other than not knowing how I got the
new font to work) is that the cursor did not change with the new font.
When I tried to backspace, the cursor moved a different amount backwards
than forwards, and I could not tell what was really on the command line.

Can anyone tell me how to reliably change the current font in a window,
and how to get the cursor to change size as well.

I would really like to use a smaller font that will give me 24x80 characters
in a smaller bordered window, (ie. I would like to be able to use several
'full screen' windows at the same time).  It makes switching between them
much easier.

Thanks

---
Tom Tkacik		GM Research Labs,   Warren MI  48090
uunet!edsews!rphroy!megatron!tkacik
"If you can't stand the bugs, stay out of the roach-motel."   Ron Guilmette

wjc@ho5cad.ATT.COM (Bill Carpenter) (06/17/89)

In article <13523@rphroy.UUCP> tkacik@rphroy.UUCP (Tom Tkacik) writes:

> I haved tried changing fonts, with little luck.
> I tried both setf and sfont, and once even got a new font to show up in
> 
> Can anyone tell me how to reliably change the current font in a window,
> and how to get the cursor to change size as well.


I assume you're talking about loading a font into slot 0 and not
having a font in any other slots.

1.  For some reason, you have to sometimes unload slot 0  first.  In
other words, to load fontXYZ in some particular window, do this:

	setf 0; setf fontXYZ 0

2.  Sometimes the alignment of things isn't too swift looking if the font
is a different size from the default.  For me, this usually clears up
if I go to another window and come back and/or do something that
clears the window and repaints it.

3.  The cursor size reflects the size of the largest font currently
loaded in a window.  Thus, if you just load something in slot 1 and
switch to it, the cursor will be appropriate for the large of slot 0
or slot 1.  (Another reason for unloading slot 0 first.)


My fiddling-with-fonts knowledge is limited to 3.51 and 3.51a.  I
don't know of any differences between these two nor in any earlier
stuff, but it wouldn't surprise me.  Like I said in the earlier
posting, it seems that font handling has a few rough edges left in it
(hence the warnings about using other than 9x12 sizes).
--
   Bill Carpenter         att!ho5cad!wjc  or  attmail!bill