Path: utzoo!attcan!uunet!husc6!think!ames!oliveb!amiga!kodiak From: kodiak@amiga.UUCP (Robert R. Burns) Newsgroups: comp.sys.amiga.tech Subject: Re: Urgent Font Questions Message-ID: <2730@amiga.UUCP> Date: 8 Aug 88 00:08:21 GMT References: <25204@ucbvax.BERKELEY.EDU> <1076@ucsd.EDU> Reply-To: kodiak@tooter.UUCP (Robert Burns) Organization: Commodore-Amiga Inc, Los Gatos CA Lines: 147 In article <1076@ucsd.EDU> hutch@net1.UUCP (Jim Hutchison) writes: )>25204@ucbvax.BERKELEY.EDU> ofer@bach.Berkeley.EDU (Jonathan Dubman) writes: ... First, some general comments Fonts are amiga load files that, when loaded, look like the diskfont structure described in include/libraries/diskfont.h. That structure is in essence a header in front of the text font structure described in include/graphics/text.h )Name.font is a header with a font count followed by headers for each font. Again, see .../diskfont.h. Workbench 1.3 (RSN) has a tool FixFonts to create these font contents files. )Rows in the font data are long word aligned. Just word aligned. )There is a hunk header, and a hunk trailer (which contains relocation )information). (the relocation information for all the pointers in the font structure) )>2. What is the difference between XSize and charBitWidth? ) )XSize is the maximum size. No. XSize is the nominal size. For non-proprotional fonts, is the same as the kern+space for every character. Note that a recent (1.3 "Courier") clarification of the meaning of "non-proportional" lets dots be rendered outside the XSize-wide character cell. ) In the case of a proportional font, this )is what you get when you ask for it in the default fixed type. Huh? Gibberish. ) The )bit width is the width of the character in the bitmap. Characters )are located by CharLoc (bit offset) and set are "charBitWidth" wide. i.e. the width of the bits set for the character in the bitmap. See below. ) )>3. What do CharSpace and CharKern REALLY mean? Given a certain )> charBitWidth and CharSpace CharKern, )> (a) how many bits are stored in the bitmap? )> (b) how many bits are displayed? ) )CharKern is supposedly (RKM) how far into the text block the character )starts. See below. ) This is not real kerning, no gentle reaching of the A under )the B (BA). ^^^^ It's not "character pair" kerning. A "kern" is the little piece of lead that hangs outside the type. Amiga fonts can do that with pixels. They just don't do it according to their neighbors. ) It is proportional spacing (which is very nice). No, proportional spacing poorly describes the CharKern facility. The effect of CharSpace might be viewed as the proportional space part, but really CharKern and CharSpace might be best viewed as CharKernSpaceLeft, and CharKernSpaceRight. See below. )is for space from the front of the letter block. CharSpace is a mystery )to me. Here's the "below". The characters are from garnet/16 --------------------------------- character bits stored in the font --------------------------------- @@@ @@@@@@ @ @@ @@ @@ @@ @ @@ @ @@ @@ @@ @ @@ @@ @@ @ @@ @@ @@ @@ @@ @@@ @@ @@ @ @@ @@ @ @ @@ @ @@@@@@@@@@@ @ @@ @@@ @ @@@ @@@@ @@@@ <----><--------------><--------------> charloc 0,6, 6,16, 22,16 "location and width of dots" kern 0, 1, -2 "add to CP before placing dots" space 7, 13, 15 "add to above result to get new CP" Note that in this example, as in real life, the characters need not be stored in the strike font in any particular order. ------------------------------- how each character would render ------------------------------- @@@ @ @@@@@@ @@ @@ @@ @@ @ @@ @ @@ @@ @@ @ @@ @@ @@ @ @@ @@ @@ @@ @@ @@@ @@ @@ @ @@ @ @@ @ @@ @ @@@@@ @@@@@@ @ @@ @@@ @ @@@ @ @@@@ @@@@ +<------------+-> <------------->+ 1 <---->+ 2 33 333 1. graphics current position before rendering characters 2. graphics current position after rendering the characters +. intermediate positions )Here comes the painful part. With 25+ pixel hi fonts, I had to add a )few extra dead rows to the font data. I don't know why. I saw some )evidence of this in the sample font, so I tried it. At 25 it was 2 )extra rows, this worked also for up to 40. At 60 I had problems again. I'm not familiar with this problem. It does not appear in fonts I've worked with. Hope this all helps. -- | / _ _|' _ |/ Bob Burns . . . . .---. . |/ (_)(_)|(_\|\ USENET: amiga!kodiak / \ |\ /| | | __ / \ |\ Kodiak \ _______/ A \| \/ |_|_|___|/ A \ | \ Software "Dedicated to the Science of Fun"\_________