Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!ub!ubvmsd.cc.buffalo.edu!v089pfrb From: v089pfrb@ubvmsd.cc.buffalo.edu (Jeffrey C Murphy) Newsgroups: comp.sys.amiga.programmer Subject: Re: Here's an EASY one [Char Set Interp] (kinda long) Message-ID: <70793@eerie.acsu.Buffalo.EDU> Date: 14 Apr 91 18:12:29 GMT References: <18f0bf14.ARN1771@prolix.pub.uu.oz.au> <1080@cbmger.UUCP> <18f73ee5.ARN18a5@prolix.pub.uu.oz.au> <18fa0585.ARN1913@prolix.pub.uu.oz.au> Sender: news@acsu.Buffalo.EDU Reply-To: v089pfrb@ubvmsd.cc.buffalo.edu Followup-To: comp.sys.amiga.programmer Organization: University at Buffalo Lines: 69 Nntp-Posting-Host: ubvmsd.cc.buffalo.edu News-Software: VAX/VMS VNEWS 1.3-4.5 In article <18fa0585.ARN1913@prolix.pub.uu.oz.au>, dac@prolix.pub.uu.oz.au (Andrew Clayton) writes... >In article <1097@cbmger.UUCP>, Peter Kittel GERMANY writes: [much deleting] >Harking back to my original question; there are bitmaps for each character in >a font, available [somehow] via pointers to structures in the font. I need to [much more deleting] >format, I pass a string to my program, and it uses the character passed as a >jump into the font structure, and then I examine what bitmap is available, and [and even some more deleting] Ok. If I understand you correctly you are looking for a pointer to where the font bitmaps are stored. Ok? When you call OpenFont() or OpenDiskFont() they will return a pointer to a TextFont structure containing info on the font (or a null if it could not locate the font). The TextFont structure looks like this: struct TextFont { struct Node TextNode; struct Message tf_Message UWORD tf_YSize; UBYTE tf_Style; UBYTE tf_Flags; UWORD tf_XSize; UWORD tf_Baseline; UWORD tf_BoldSmear; UWORD tf_Accessors; UBYTE tf_LoChar; UBYTE tf_HiChar; APTR tf_CharData; UWORD tf_Modulo; APTR tf_CharLoc; APTR tf_CharSpace; APTR tf_CharKern; }; Ok. "tf_CharData" contains a pointer to the memory location where the bitmap for the font is kept. Figuring out how it is stored is another matter. From "Amiga Programmer's Handbook" (an old book I know...) page 309: [paraphrased kindof to cut down on typing :) ] tf_Modulo. This param contains the number of bytes per font character line. The bit data for each font are organized with the bits of the top line of the first character adjacent to the bits of the top line of the second character. This param tells the system where to find the info for the next line of a character. For example, if the bit-packed character set needs 20 words of 16 bits each to hold the top line of all characters in the set, then tf_Modulo is set to 40. The system must add 40 to the character matrix pointer to go from the first line to the second to the third... etc... for each character. tf_CharLoc. This is a pointer to a memory location where an array of paired values exists for each character in the font. The array is arranged in two- word sets; the first is the bit offset into the bitpacked array for this character, and the second word is the width of the specific character in bits. So you have to set up a textAttr structure and call Open(Disk)Font() with a pointer to this structure. Then, in return, you get a pointer to the TextFont structure which you use to access the font's bitmap. Hope this answered your original question. l8r jm