🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.amiga.tech
Article #9421

Re: Urgent Font Questions

#9421
From: Jim Hutchison
Date: Wed, 03 Aug 1988 07:16
62 lines
3072 bytes
<25204@ucbvax.BERKELEY.EDU> ofer@bach.Berkeley.EDU (Jonathan Dubman) writes:
>[...]  The
>program has to pick out certain characters from an existing font in a certain
>order and save them under a new name.

Basicly you are making a new font from an old one.  A couple of notables
for you.  first, fonts are loadable hunks.  Second, I still don't fully
understand them.  I have gone this route to convert some fonts I desperately
needed to generate from an alternate form.  Since both the original form
and names are copyrighted, let that end here.

>1.	How do I write out a font file given the TextFont structure in memory?
>	Say I change around a few characters in Diamond and want to resave the
>	font on disk...  It begins with a 3F3 which means it is some kind of
>	load module?  No comprendo.

Name.font is a header with a font count followed by headers for each font.

Rows in the font data are long word aligned.

There is a hunk header, and a hunk trailer (which contains relocation
information).

>2.	What is the difference between XSize and charBitWidth?

XSize is the maximum size.  In the case of a proportional font, this
is what you get when you ask for it in the default fixed type.  The
bit width is the width of the character in the bitmap.  Characters
are located by CharLoc (bit offset) and set are "charBitWidth" wide.

>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.  This is not real kerning, no gentle reaching of the A under
the B (BA).  It is proportional spacing (which is very nice).  CharSpace
is for space from the front of the letter block.  CharSpace is a mystery
to me.

Special note, you may not immediately be aware of this.  The bitmaps are
stored scanline fashion.  With the first row of the bitmap being the
first row of *all* of the glyphs.  Holy character generators Batman!

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.

Where am I going wrong.

>	-Jonathan Dubman
>	 Overworked UC Berkeley student

Student?  Is that why I'm working so hard.  D*mn, I guess I'd
better graduate.

Hope this helps.

/*    Jim Hutchison   		UUCP:	{dcdwest,ucbvax}!cs!net1!hutch
		    		ARPA:	JHutchison@ucsd.edu		*/
Technical Details
Message-ID: <1076@ucsd.EDU>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!husc6!cmcl2!rutgers!ucsd!net1!hutch
References: <25204@ucbvax.BERKELEY.EDU>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!husc6!cmcl2!rutgers!ucsd!net1!hutch
From: hutch@net1.ucsd.edu (Jim Hutchison)
Newsgroups: comp.sys.amiga.tech
Subject: Re: Urgent Font Questions
Message-ID: <1076@ucsd.EDU>
Date: 3 Aug 88 07:16:58 GMT
References: <25204@ucbvax.BERKELEY.EDU>
Sender: nobody@ucsd.EDU
Reply-To: hutch@net1.UUCP (Jim Hutchison)
Organization: UCSD EMU Project (Educational Microcomputer Unix)
Lines: 62