PCXUTILS - by Lee Hamel (Patch) - hamell@cs.pdx.edu - *Avalanche* coder ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ This package contains a number of small, yet useful utilities to manipulate PCX files and allow you to use the images in your programs. The main focus is on the font converter, which is VERY handy ... Ever wish that you could convert some cool font into an easy-to-use, fast, formatted data type? Wish no longer ... this program will do it for you. It's very FAST, very simple, and very free =) The format of the FNT file is as follows: byte 0 - 2: string signature 'LMH' (for error checking) byte 3 : # of colors used by the fonts (any color that is 0,0,0 is considered empty) byte 4 : starting palette color used by the fonts (first color that is not 0,0,0) byte 5 - 772: RGB data for 256 possible colors (768 bytes) word 773 - 1284: offset of all 256 ASCII chars (in order), relative to byte 0 byte 1285 - : data for the fonts 1st byte is the char in the ASCII table 2nd byte is the X size (width) 3rd byte is the Y size (height) X*Y bytes of the font - saved column by column top to bottom, left to right If the particular ASCII char is not used, X and Y size will be 0, and there will be no data for it. Fonts are expected to be in the following format: ÚÄÂÄÂÄÂÄÂÄÂÄÄÂÄÄÄÄ Note the 0s along the top row and far right column. 0 0 0 0 0 0 Ä´ This is an example of the pixel placement of an A. 0 1 1 1 0 0 Ä´ The 1s represent where the different colors are at. 1 1 1 1 1 0 Ä´ When drawing the fonts, make sure each lettter has a 1 1 0 1 1 0 Ä´ border along the top side, otherwise the conversion 1 1 1 1 1 0 Ä´ algorithm will mess up. Just stack all of your fonts 1 1 0 1 1 0 Ä´ on top of each other and side by side, save the picture 1 1 0 1 1 0 Ä´ as a PCX, and you're done! How to use PCX2FNT ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Usage: pcx2fnt [-FNT] PCXFILE [-SHOW] where: -FNT - show the FNT format PCXFILE - the PCX file to read (no extension) -SHOW - show the PCX on the screen Example call: pcx2fnt fontfile -show This will read the file FONTFILE.PCX, show it to the screen, and will read the configuration information from FONTFILE.CFG. Example FONTFILE.CFG: charrows = 4 charsinrow = 3 4 5 6 065 = 10 x 10 The program expects 4 rows of fonts with 3 fonts in the 1st row, 4 in the 2nd, 5 in the 3rd, and 6 in the 4th. 065 represents ASCII char A, and it is a 10 x 10 bitmap. The file FONTFILE.FNT will be created. Use a paint program to figure out the pixel count. The blank border along the top and right of each font DOES NOT count as part of the height or width! Any line that starts with ; is considered a comment (just like in ASM, .INI files, etc.) Files in this package: ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ PCXUTILS.DOC - This doc file PCXUTILS.NFO - NFO file about Avalanche and the programs FONTSET1.PCX - PCX picture of a fontset FONTSET1.CFG - config file for FONTSET1.PCX FONTSET2.PCX - PCX picture of a fontset FONTSET2.CFG - config file for FONTSET2.PCX DRAWSTR.ASM - 320x200x256 tweaked mode routine for drawing a string (FAST!) PCXVIEW.C - PCX file viewer source PCXVIEW.EXE - PCX file viewer executable PCX2FNT.C - PCX to FNT format source (sloppy, but works!) PCX2FNT.EXE - PCX to FNT format executable PCX2RAW.C - PCX to raw format converter source (top row to bottom, left to right, palette saved in other file) PCX2RAW.EXE - PCX to raw format converter executable PCX2TRAW.C - PCX to tweaked mode raw format converter source (plane 0 bytes saved, then 1, then 2, then 3) PCX2TRAW.EXE - PCX to tweaked mode raw format converter executable If you use this program to create some fonts you use in a product, please give credit accordingly. If you have any further questions, you can reach me on my board (read PCXUTILS.NFO), or at the Internet address listed at the top.