Path: utzoo!mnetor!uunet!husc6!hao!ames!amdahl!oliveb!amiga!kodiak From: kodiak@amiga.UUCP (Robert R. Burns) Newsgroups: comp.sys.amiga Subject: Re: Fonts! Message-ID: <1974@amiga.amiga.UUCP> Date: 21 Dec 87 19:06:00 GMT References: <2041@cup.portal.com> Reply-To: kodiak@amiga.UUCP (Robert R. Burns) Organization: Commodore-Amiga Inc., 16795 Lark Ave. Suite 106, Los Gatos CA 95030 Lines: 44 In article <2041@cup.portal.com> Steve_A_Hales@cup.portal.com writes: > Augh!!!! ... > I have this real strange font related problem (no, not again). > I've opened a font with OpenDiskFont. It returns a pointer to > the TextFont structure. Well, I need to obtain the name of the > font from the TextFont structure, and guess what, it changes! ... >OpenDiskFont ( ->ln_Name ) >21dc5a: 00 20 06 36 00 21 98 8a 0c 00 00 45 27 1e 00 00 . .6.!.....E'... > Does anyone have any clue what so ever? This is very repeatable, using > specific fonts. However I am using the ColorFont structure from > Inter/Active, but that really should make no difference. ^^^^^^^^^^^^^^^^^^^^^^^^^ BRRRAAAP! Here's the bug: when you use InterActive's Calligrapher to create a font from scratch, it does not correctly create a load image whose ln_Name is just the relocation value. If the font is just a modification of a good old one, everything's fine. I see from the ln_Name you have that expansion memory was used when this font was first created, thus the absolute ln_Name value was 0x2xxxxx. When "relocated" to 21dcxx, you get the trashed 0x45271e. Unfortunately, the diskfont.library loads a font, adds it to the list of fonts, and returns you a pointer to the font without getting that pointer from the font list. (If it had been gotten from the list, 1. it would be larger and slower, but 2. this bug would have been caught sooner.) Now that the font is on the font list, AvailFonts will tell you about it, bad name and all: remember that the name is null terminated and that the name is stored in the buffer you give AvailFonts. InterActive has written a font patcher to fix up all your fonts -- This longword in the file should always have the value 0x0000001a, which, if you look at "libraries/diskfont.h", is the loaded offset of dfh_Name. If you have a binary file editor, I think you'll find this longword at offset 0x64 into the font file. SO... set the longword at 0x64 in the font file to 0x0000001a and you're fixed. >UUCP: Steve_A_Hales@cup.portal.com - Bob "Kodiak" Burns