[comp.sys.amiga] Disk fonts: how to use?

peter@sugar.UUCP (Peter da Silva) (08/11/87)

I'm trying to open a font I already know the name of. Here's what I'm using:

struct TextAttr tr_font_attr = {
	"tracers/6",
	6,
	FS_NORMAL,
	FPF_ROMFONT | FPF_DISKFONT | FPF_PROPORTIONAL | FPF_DESIGNED | FPF_REMOVED
};

DiskfontBase = OpenLibrary("diskfont.library", 0);
font = OpenDiskFont(&tr_font_attr);

I've tried other combinations of FPF_*. I've tried "tracers". OpenLibrary
always succeeds. OpenDiskFont always fails.
-- 
-- Peter da Silva `-_-' ...!seismo!soma!uhnix1!sugar!peter (I said, NO PHOTOS!)

andy@cbmvax.UUCP (Andy Finkel) (08/13/87)

In article <475@sugar.UUCP> peter@sugar.UUCP (Peter da Silva) writes:
>I'm trying to open a font I already know the name of. Here's what I'm using:

>I've tried other combinations of FPF_*. I've tried "tracers". OpenLibrary
>always succeeds. OpenDiskFont always fails.

A combination of flags that should work is:

FPF_ROMFONT|FPF_DISKFONT|FPF_PROPORTIONAL|FPF_DESIGNED

and your name should be tracers.font, so your structure should be:

struct TextAttr tr_font_attr = {
	"tracers.font",
	6,
	FS_NORMAL,
	FPF_ROMFONT|FPF_DISKFONT|FPF_PROPORTIONAL|FPF_DESIGNED
};

(you might also need a tracer.font file containing the font header
information for the font sizes in tracer in the font: directory.
But, then again, since you've got the name, you might not.  Try it and see.
-- 
andy finkel		{ihnp4|seismo|allegra}!cbmvax!andy 
Commodore-Amiga, Inc.

"The goal of Computer Science is to build something that will last at
least until we've finished building it."

Any expressed opinions are mine; but feel free to share.
I disclaim all responsibilities, all shapes, all sizes, all colors.

peter@sugar.UUCP (Peter da Silva) (08/20/87)

I get the message. You should specify the name ".font", despite the document's
references to "fontname/size" in a context that leads one to believe that's
what you should do. Look, the documentation is abysmal, OK? Why they didn't
just use the -man macros (they were obviously using *roff), and follow the UNIX
documentation standards?

My main peeve is this: where they have:

	process = CreateProc(name, pri, segment, stacksize)
	D0                   D1    D2   D3       D4

Why didn't they do this:

	process = CreateProc(name, pri, segment, stacksize)
	struct MessagePort *process; /* D0 */
	UBYTE *name; /* D1 */
	int pri; /* D2 */
	...

You have to guess at types all over the place. Is there a decent set of docs
anywhere?
-- 
-- Peter da Silva `-_-' ...!seismo!soma!uhnix1!sugar!peter (I said, NO PHOTOS!)