Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!gem.mps.ohio-state.edu!ginosko!uunet!zephyr!tektronix!psueea!parsely!sopwith!snoopy From: snoopy@sopwith.UUCP (Snoopy) Newsgroups: comp.fonts Subject: Re: Format of Hershey fonts needed Keywords: font format Message-ID: <253@sopwith.UUCP> Date: 17 Jul 89 04:12:06 GMT References: <391@iconsys.UUCP> Reply-To: snoopy@sopwith.UUCP (Snoopy) Organization: The Daisy Hill Puppy Farm Lines: 49 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."