home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.mac.programmer
- Path: sparky!uunet!wupost!gumby!destroyer!news.iastate.edu!niko
- From: niko@iastate.edu (Nikolaus E Schuessler)
- Subject: Simple (?) Resource Manager program?
- Message-ID: <1992Sep6.230145.18127@news.iastate.edu>
- Sender: news@news.iastate.edu (USENET News System)
- Organization: Iowa State University, Ames, IA
- Date: Sun, 6 Sep 1992 23:01:45 GMT
- Lines: 59
-
- I recently thought I'd write a simple getResource program to read
- in a font and dump it out in bitmap form (array declarations in C)
- to be compiled with a program. I however get really weird numbers..
- i.e. fontwidth of > 1000 or height > 100? That's outrageous...
- (plus no matter what id I get, the numbers are always the same).
- I think I'm missing something basic.
-
- Here is the program...
-
- void main(void)
- {
- Handle ahand;
- FontRec *fontptr;
- char s[80];
- short fontid;
- short error;
-
- printf("Enter font id: ");
- gets(s);
- fontid = atoi(s);
-
- printf("Getting 'FONT' id %d\n",fontid);
-
- ahand = GetResource('FONT',0);
-
- if (ahand == NULL) {
- printf("Got null handle... exiting (1).\n");
- exit(1);
- }
-
- error = ResError();
- if (error) {
- printf("Got reserror %d (1)\n",error);
- exit(1);
- }
-
- LoadResource(ahand);
-
- error = ResError();
- if (error) {
- printf("Got reserror %d (2)\n",error);
- exit(1);
- }
-
- HLock(ahand);
- fontptr = (FontRec *) (*ahand);
-
- fontptr-> xxx /* this should be the fontrec data right ? */
-
- [...]
-
- }
-
- Thanks anyone who can help...
- --
- Niko Schuessler
- Project Vincent Systems Manager email: niko@iastate.edu
- Iowa State University Computation Center voice: (515) 294-1672
- Ames IA 50010 snail: 272 Durham
-