Title: | AMIGA NOTES |
Notice: | Join us in the *NEW* conference - HYDRA::AMIGA_V2 |
Moderator: | HYDRA::MOORE |
Created: | Sat Apr 26 1986 |
Last Modified: | Wed Feb 05 1992 |
Last Successful Update: | Fri Jun 06 1997 |
Number of topics: | 5378 |
Total number of notes: | 38326 |
I Was wondering if any other programmers out there could help me ... I trying to attach a custom font to my on custom screen through intuition. To do this I have to give a pointer to a font in the NewScreen Structure. The problem is getting the pointer. The font I want to use is in the FONTS: directory. As far as I could work out from the Manual's this is a fragment of the code to get this pointer: OpenDiskFont =-30 ;Open the Diskfont.library and save d0->diskbase move.l diskbase,a6 move.l TextAttr,a0 jsr OpenDiskfont(a6) move.l d0,fontbase ;Close the Diskfont.library rts TextAttr: dc.l fontname dc.w 8 dc.b 0 dc.b 0 fontname: dc.b 'sample.font',0 even END After assembling this and executing it through a Debugger I find that when it executes the jsr OpenDiskfont call it takes approx. 40 secs with NO disk access. At the end of this time I get 0 back in D0 which according to intuition means that it could'nt find the font. Has anyone else managed to get this to work ???? I went through the C source code to SetFont but as far as I can see I've everything correct. Thanks in advice for the help.
T.R | Title | User | Personal Name | Date | Lines |
---|---|---|---|---|---|
3787.1 | try this | DEMOAX::MCKENDRY | Nasty, Brutish, and Short | Mon May 21 1990 10:54 | 14 |
This is a guess, but I'd suggest changing "move.l TextAttr,a0" to "lea TextAttr,a0" . I think you'll find that after "move.l TextAttr,a0", a0 contains the address of your string "fontname," not the address of your TextAttr structure. And I suspect the OpenDiskfont routine would rather have the structure. "lea" will load a0 with the structure address. Of course, I could be wrong. -John | |||||
3787.2 | Boy, am I Stupid!! | GIDDAY::MORAN | I'm not bad-I'm just drawn that way! | Tue May 22 1990 19:49 | 10 |
You are totally 100% right!! Silly me, would you believe that I really meant lea?? Now for the next challange - Alt Keymaps in a string gadget. Thanks for the help. Shaun. |