[comp.fonts] Format of Hershey fonts needed

danny@iconsys.UUCP (Danny Young) (07/15/89)

I recently ftp'd the Hershey font set from a Usenet archive site and cannot
find a file anywhere among the distribution detailing the format of the fonts
as posted to the net.

Would someone with access to this information please send me some mail, I
would appreciate any help at all.

Thanks.

-- 
Danny Young		    USENET:  uunet!iconsys!danny
Icon International, Inc.    ARPANET: icon%byuadam.bitnet@wiscvm.wisc.edu   
764 East Timpanogos Pkwy    BITNET: icon%byuadam.bitnet
Orem, Utah 84057-6212       Telephone: (801) 225-6888

lee@uhccux.uhcc.hawaii.edu (Greg Lee) (07/15/89)

From article <391@iconsys.UUCP>, by danny@iconsys.UUCP (Danny Young):
" 
" I recently ftp'd the Hershey font set from a Usenet archive site and cannot
" find a file anywhere among the distribution detailing the format of the fonts
" as posted to the net.

I think the only information on format available is the code in the
file hershey.c.
				Greg, lee@uhccux.uhcc.hawaii.edu

snoopy@sopwith.UUCP (Snoopy) (07/17/89)

In article <391@iconsys.UUCP> danny@iconsys.UUCP (Danny Young) writes:

|I recently ftp'd the Hershey font set from a Usenet archive site and cannot
|find a file anywhere among the distribution detailing the format of the fonts
|as posted to the net.

I have reverse-engineered the format.  Here is a start at an explaination,
constructive criticism welcome, as I am working on an improved version
of the Hershey-to-Postscript package and will be including an explanation.

The Hershey glyphs are stroked, as opposed to filled outlines or bitmaps.
Thus they are suitable for pen-plotters and vector displays as well as
raster devices.  They are based on an x-y coordinate system, with the origin
in the center, x increasing to the right and y increasing *down*.

The first 5 bytes are the (decimal) glyph number.  The next three bytes
give the number of x-y data pairs (in decimal), including the left and right
bounding values.  Multiply by two to get the number of bytes of data.  The
first byte-pair of data are the left and right bounding values.  These are
x coordinates only, and include any desired blank space.  Vertical bounding
values are not given.  The remaining byte-pairs of data are x-y coordinates.
Vectors are drawn from one coordinate to the next until either a move pen
command is encountered or the data is exhausted.  The special byte-pair " R"
(space capital-R) means lift the pen, move to the next coordinate pair, and
lower the pen.  Glyphs with large amounts of data have newlines inserted to
keep the line length under 80 chars.  These newlines are not part of the
gylph data, and are not plotted or included in the byte-pair count.

The data is encoded by adding the ASCII character 'R'.  The origin is
encoded as "RR".  The point (-3,5) is encoded as "OW".  And so on.

Start by decoding a few simple glyphs, and this should become clear.
Glyph 724 is a hyphen, 999 is an underscore, 1405 is a left square
bracket, 1406 is a right square bracket.  (These are in the "occidental"
set, not the "oriental" set.)

There is a program by Guy Riddle which creates PostScript fonts from the
Hershey data.  It should be available from the same archives as the Hershey
glyph data.  I am working on a package with an improved version of this
program, additional selection files, and additional glyphs.  Persons
interested in being alpha sites should send me email.

    _____     						  .-----.
   /_____\    Snoopy					./  RIP	 \.
  /_______\   qiclab!sopwith!snoopy			|  	  |
    |___|     parsely!sopwith!snoopy			| tekecs  |
    |___|     sun!nosun!illian!sopwith!snoopy		|_________|

	    "But we're only up to the fourth inning."

ken@cs.rochester.edu (Ken Yap) (07/18/89)

There is a xhershey program in the Clarkson archive that displays
Hershey characters in an X window and generates MF code. Sorry I forget
the directory.

The description of the format by Snoopy is correct. As stated, the y
offset of the baseline is not in the per character information. It
varies, but is generally some small constant, e.g. 9, over a set of
characters in a given style.

Also this format is not the original format as it comes off the tapes.
Apparently this "centered around R encoding" was invented for Usenet
distribution by the Hershey Font Consortium (or something like that), a
body of people who chipped in enough money to buy a tape, distributed
the fonts, and thereafter dissolved the consortium.