[comp.sys.apple] custom icons question again

hartkopf@tramp.Colorado.EDU (HARTKOPF JEFFREY M) (06/03/89)

Thanks, Dave Lyons, for the info on using the DrawIcon procedure.  However,
this only partially answers my question.  What I also need is how I would
convert the hex representation of an icon (each pixel designated by a hex
digit 1-F, representing it's color) into an icon in the first place  (not
from an icon editor but right in my program so I can then use DrawIcon).
As I said in my previous post, I am using TML Pascal so I'd appreciate
Pascal examples although I also know C.  If anyone knows how to do this
and would be willing to take the time to give me an example, I'd really
appreciate it.  I suppose this is explained in the toolbox reference
manuals but unfortunately I don't have access to them yet.

Another question someone may know the answer to is how I would write text
to the desktop screen using something other than Shaston 8 font.  For example,
how would I write with New York, Bold, 24 point.  I have tried various
combinations of the Font Manager commands to no avail, and using DrawString
(maybe I shouldn't use DrawString?).  Again, thanks much for help.

dlyons@Apple.COM (David Lyons) (06/05/89)

In article <9175@boulder.Colorado.EDU> hartkopf@tramp.Colorado.EDU (HARTKOPF JEFFREY M) writes:
>Thanks, Dave Lyons, for the info on using the DrawIcon procedure.  However,
>this only partially answers my question.  What I also need is how I would
>convert the hex representation of an icon (each pixel designated by a hex
>digit 1-F, representing it's color) into an icon in the first place  (not
       ^ 0-F!
>from an icon editor but right in my program so I can then use DrawIcon).
>As I said in my previous post, I am using TML Pascal so I'd appreciate
>Pascal examples although I also know C.

You need 2 things:  some space in memory to construct the *real* image of
the icon, and a way to convert the hex strings into real data.  To get the
space, just declare an array of char as big as you want.  VAR MyIcon:
array[0..200] of char; or whatever.  Then use StuffHex to convert the data
(look it up in your TML manual to get the parameters right--I may have them
wrong here).  Something like  StuffHex(@MyIcon[0],'01fe02fd03fc');
StuffHex(@MyIcon[6],'04fb05fa06f9'), etc.

>Another question someone may know the answer to is how I would write text
>to the desktop screen using something other than Shaston 8 font.  For example,
>how would I write with New York, Bold, 24 point.  I have tried various
>combinations of the Font Manager commands to no avail, and using DrawString
>(maybe I shouldn't use DrawString?).  Again, thanks much for help.

You *need* those toolbox reference manuals.  Have you successfully loaded
and started up the font manager?  Once you've done that, use GetFamNum to
help compute a FontID to feed to InstallFont.  Make sure that you have
SetPort to the right port (the one you want to set the font for) before
calling InstallFont.  SetTextFace will let you ask for Bold.

Note that you should *not* use hard-coded family numbers--use family names
instead.

 --Dave Lyons, Apple Computer, Inc.          |   DAL Systems
   AppleLink--Apple Edition: DAVE.LYONS      |   P.O. Box 875
   AppleLink--Personal Edition: Dave Lyons   |   Cupertino, CA 95015-0875
   GEnie: D.LYONS2 or DAVE.LYONS         CompuServe: 72177,3233
   Internet/BITNET:  dlyons@apple.com    UUCP:  ...!ames!apple!dlyons

   My opinions are my own, not Apple's.