[comp.windows.news] Creating new icon fonts - Help required

cathy@cs.glasgow.ac.uk (Catherine Anne Wood) (08/10/88)

Is there an easy way to incorporate new icons into NeWS ?
At the moment the only way I can see is to generate a new icon
font ... and that seems to have its problems.

I want to be able to use icons I design with the SunView icon editor.
I have managed to create a new icon font using the procedure described
in the manual (Chapter 16) but still have two problems :

a) Having created my own font how do I use BOTH it and the standard icon
   font.  I want to create items using both fonts. What I really want is to
   be able to dynamically alter the font used to create items so I (and other
   users of my system) can have different fonts for different uses.

b) Any changes made to the font after NeWS has been started up are 
   unavailable until the next time NeWS is loaded.  There is a routine

   "findfilefont" - Reads the font family file named by the string and 
   constructs and returns a font object that refers to it

   Which the manual says is the routine to use to have a font loaded into NeWS
   after it has started up.

   However I cannot get this to work - it keeps giving the error
   "invalidfont".  The font does however work okay if I stop NeWS and restart
   it.

   Is there an easier way !!!! - Am I going about this the hard way ?



ARPANet: cathy%cs.glasgow.ac.uk@nss.cs.ucl.ac.uk 
JANET:   cathy@uk.ac.glasgow.cs	 UseNet:  mcvax!ukc!cs.glasgow.ac.uk!cathy
Mail:    Cathy Wood, Computer Science, 17 Lilybank Gardens, GB-GLASGOW G12 8QQ 

elwell@ichthyosaur.cis.ohio-state.edu (Clayton M. Elwell) (08/12/88)

cathy@cs.glasgow.ac.uk (Catherine Anne Wood) writes:
    Is there an easy way to incorporate new icons into NeWS ?
    At the moment the only way I can see is to generate a new icon
    font ... and that seems to have its problems.

Well, I've played with this a little.  What I did was to create a new
window class that (among other things) overrides the standard
PaintIcon method.  If the window's IconImage is a name, it just shows
the icon as usual.  If it's a canvas, though, it paints it using
'imagemaskcanvas' if it's monochrome or 'imagecanvas' if it's color.
This lets you have multicolored icons on a color display.

This way, too, the new icons can be compiled into your program (using
buildimage), so that new users don't have to make sure that they have
a new font installed.


Clayton M. Elwell <elwell@tut.cis.ohio-state.edu>
Ohio State University CIS Dept. Research Computing Facility

"... there was a *third* possibility that we hadn't even counted
upon ..."		--Arlo Guthrie, "Alice's Restaurant"