Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!codas!peora!pesnta!phri!roy From: roy@phri.UUCP Newsgroups: comp.text,comp.unix.wizards Subject: Questions about vfont file format Message-ID: <2583@phri.UUCP> Date: Thu, 29-Jan-87 21:51:07 EST Article-I.D.: phri.2583 Posted: Thu Jan 29 21:51:07 1987 Date-Received: Sat, 31-Jan-87 04:17:52 EST Reply-To: roy@phri.UUCP (Roy Smith) Organization: Public Health Research Inst. (NY, NY) Lines: 28 Xref: watmath comp.text:271 comp.unix.wizards:748 I'm trying to write some utilities to work with vfont files, but the vfont(5) man page is not entirely unambigious on a few points. I'm working from the 4.2 man page, and trying to get this working on both Vax and Sun systems (yes, I know about vswap). From looking at octal dumps, I figured out that if you take the dispatch.addr field and add it to sizeof(header) + 256*sizeof(dispatch) you get something you can hand to seek(). From the man page, it is not really clear if dispatch.addr is an offset from the beginning of the file (from the name, you would guess this is right, silly you), from the beginning of the bitmaps, or maybe even from the beginning (or end??) of the dispatch structure for that particular glyph. My real question is about the redundancy in the dispatch.addr and the dispatch.nbytes entries. You can calculate dispatch[n].addr as SH + 256*SD + sum from i=0 to n-1 {dispatch[i].nbytes}, where SH = sizeof (struct header) and SD = sizeof (struct dispatch), assuming that the bitmaps are in order and close packed. Is this a valid assumption? If I want to be careful that I'm not eating a random file (more careful than just checking the magic number), can I check that the above condition is true and complain about a badly formated file if it's not? -- Roy Smith, {allegra,cmcl2,philabs}!phri!roy System Administrator, Public Health Research Institute 455 First Avenue, New York, NY 10016 "you can't spell deoxyribonucleic without unix!"