From: Neil Goldberg Newsgroups: comp.os.msdos.djgpp Subject: Re: decoding pcx header Date: Mon, 09 Aug 1999 12:38:59 +0100 Organization: The MITRE Corporation Lines: 49 Message-ID: <37AEBDD3.ED7@mitre.org> References: <37AEBDCF DOT 5475 AT surfsouth DOT com> NNTP-Posting-Host: mm58842-pc.mitre.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: top.mitre.org 934216602 16417 128.29.96.60 (9 Aug 1999 16:36:42 GMT) X-Complaints-To: usenet AT news DOT mitre DOT org NNTP-Posting-Date: 9 Aug 1999 16:36:42 GMT X-Mailer: Mozilla 3.04 (WinNT; I) To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Chris Holmes wrote: > > YUBS wrote: > > > > hey there, I'm having some trouble decoding the pcx header. I hunted down > > the format and everything, but I still can't seem to be able to read the > > dimensions of the image from the header. If anybody knows anywhere I could > > get some info on doing this I'd really appreciate it. Basically, I've tried > > reading it as a text file and as a binary file, and I've tried reading > > character by character and through formatted input (ie using fscanf) but I > > can't seem to get it to work. Anyway, thanks for any help you can offer. > > struct PCXheader > { > char pcxID; > char version; > char rleEncoding; > char bitsPerPixel; > int x1,y1; > int x2,y2; > int hRes; > int vRes; > unsigned char palette[48]; > char reserved; > char colorPlanes; > int bytesPerLine; > int paletteType; > char unused[58]; > }; > > width = x2- x1 +1; > height = y2 - y1 +1; > > I can send you the rest of my source code if you need it. Now if > someone has a jpeg reader, that's impressive . > > I wonder if anyone out there knows the structure to windows font > files... I've been looking for them for awhile now. Shawn Hagreaves (Allegro author) has *source*/binaries to his program that rasterizes TTFs into PCX files. Win32 version: http://www.talula.demon.co.uk/ttf2pcx/ttf2pcx.zip Or email him about how/where he got info on intrepeting TTFs. shawn AT talula DOT demon DOT co DOT uk moogla moogla