Path: utzoo!attcan!uunet!husc6!mailrus!purdue!decwrl!labrea!polya!ali From: ali@polya.Stanford.EDU (Ali T. Ozer) Newsgroups: comp.sys.amiga.tech Subject: Font loading problem Message-ID: <3704@polya.Stanford.EDU> Date: 23 Aug 88 14:29:08 GMT Reply-To: aozer@next.com (Ali Ozer) Organization: Stanford University Lines: 34 --- Here's what I'm trying to do: Load a font from a subdirectory of the directory where my executable is. Call this subdirectory "myfonts". First, there seems to be no way to get OpenDiskFont() to look at "myfonts" without reassigning fonts:. Is this correct? (If not, how do you do it?) Assuming you have to reassign fonts:, here's the horrible thing I was doing as a "temporary" solution: Execute ("assign savefonts: fonts:", NULL, NULL); Execute ("assign fonts: myfonts", NULL, NULL); myfont = OpenDiskFont (blah blah); Execute ("assign fonts: savefonts:", NULL, NULL); Execute ("assign savefonts:", NULL, NULL); This is real ugly; it should have Forbid()/Permit() around it, and even then it might die, and besides, it doesn't work when the program is run from the Workbench, because Execute() is not connected to the right directory anymore. So then I tried to do the following sort of thing: BPTR seg = LoadSeg ("myfonts/fontname/30"); long *foo = BADDR(seg); /* bptr to C pointer */ AddFont (&foo[2]); /* Skip over the next ptr and moveq/rts */ ... then OpenFont ... After a few attempts that failed, I kind of dialed up, and while at it, decided to throw the question the way of comp.sys.amiga.tech. Is there any graceful way of doing what I'm trying to do? And, how about the LoadSeg/AddFont approach --- Will it eventually work if I work at it? Ali Ozer, aozer@next.com, ali@polya.stanford.edu