Questions about vfont file format

roy at phri.UUCP roy at phri.UUCP
Fri Jan 30 12:51:07 AEST 1987


	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!"



More information about the Comp.unix.wizards mailing list