#
# $Source: /local/projects/X/fed/RCS/README,v $
# $Header: README,v 1.4 87/04/09 12:32:54 jim Exp $
#
#                     Copyright (c) 1987 Cognition Inc.
#
# Permission to use, copy, modify and distribute this software and its
# documentation for any purpose and without fee is hereby granted, provided
# that the above copyright notice appear in all copies, and that both
# that copyright notice and this permission notice appear in supporting
# documentation, and that the name of Cognition Inc. not be used in
# advertising or publicity pertaining to distribution of the software
# without specific, written prior permission.  Cognition Inc. makes no
# representations about the suitability of this software for any purpose.
# It is provided "as-is" without express or implied warranty.
#
#							  Jim Fulton
#							  Cognition Inc.
#                                                         900 Tech Park Drive
# uucp:  ...!{mit-eddie,talcott,necntc}!ci-dandelion!jim  Billerica, MA
# arpa:  jim@athena.mit.edu, fulton@eddie.mit.edu         (617) 667-4800
#


We are releasing our font editor "fed" in the hopes that it is as useful to
other people.  It was written on a vax, for a vax as an after hours project
that until recently wasn't even considered "supported" here in house.
Hopefully it will provide something to work from for those people who don't
have vaxes.  Public acknowledgement and profuse thanks to the person who makes
it run on a 68000 with the fewest number of changes.

The good news is that we've been using it for a year to create and polish over
two dozen fonts for our product, ranging from a 3x5 character set all the up
to a 912x164 pixel image of our company logo.  It is regularly used to edit
full 100x100 pixel fonts and produces .onx files that work successfully on
the following X implementations:  PC/X, QDSS, QVSS, and VS100.

I've tried to localize the bit munging and to make it run in finite time.  The
Makefile contains commented out rules for compiling with inline for the calls
to extzv() and insv() although it uses C versions of these by default.  If you
have inline I'd recommend you use it for no other reason than that is what has
been tested the most.  I wrote the C version this week so that it would help
those sites without full distributions or who are trying to port.  Although
both versions give identical results for the half dozen fonts on which I've
tried them I use the inline code.

Unfortunately there are no man pages.  However, the programs are relatively
straightforward to use.  This distribution contains the following:

    fed			break apart/compile/dump info/print glyphs from
			fonts.

    ba			bitmap-to-ascii/ascii-to-bitmap filter.  used to 
			print out a bitmap file so that you can look at it
			or edit it.  I use this when designing cursor bitmaps
			other bit patterns (or pictures for inclusion in
			text since you can use bitmap to do all the work).

    scalefont		takes one decompiled font and scales each of the 
			characters so that you can make another font of the
			same relative sizes.  It does NOT try and scale the
			actually bitmaps.  This is useful if you are trying
			to build a family of related fonts.

    displayfile		useful for testing your fonts without having to copy
			them into the system font area.

    font.txt		a description of the format of .onx files.  However,
			the GetFont() and PutFont() routines are probably the
			best source of documentation.


Each of the programs take a -help flag which will tell you what command line
arguments to give.  So save you some time, here are some examples:

	fed -d helv12b		creates a subdirectory called helv12b and 
			writes a file for each character (with the name ###
			where ### = character code in octal) and a "profile"
			containing general information about all of the
			characters.  You can then go down into this directory
			and use bitmap to edit any of these files.  It finds
			the .onx file corresponding to "name" as follows:

					name.suffix
					defdir/name.suffix
					name

			where name is the string that you give on the command
			line.  

	fed -c helv12b		compiles the font found in the directory
			./helv12b (this command is given in the same place as
			the original fed -d helv12b).  It writes out a new
			font file ./helv12b.onx.  You can then look at it using
			the displayfile program or by saying xfd with a full
			pathname.

	fed -i micr25		dumps information about the font onto stdout.
			For example (most of the leftarray and width data has
			been editted out for the sake of brevity):

                        FONT:
                        name = micr25, [first,last] = [0,127], space = 32,
                        avg_width = 14, height = 25, fixed = 0, base = 5
                        FontPriv:
                          maxwidth = 28, wpitch = 240
                          leftedge array size [0,1910] = 129, leftarray table:
                        0     7    23    45    65    82    94   106   122   137
                                                 ...
                        
                        1821  1836  1851  1865  1876  1883  1894  1910  1910
                
                          width table size = 128, width table:
                        7    16    22    20    17    12    12    16    15     0
                                                 ...
                        
                        15    15    14    11     7    11    16     0
                
	fed -p oldeng		prints out the glyphs of each of the characters
			int the font.

						...

			  Font oldeng, char 65 ('A'), starts at 392, width 26:
			------------------------------
			---######---------------------
			--#----###--------------------
			-#-------##-------------------
			-#-------###------------------
			#--------###------------------
			#---------###-----------------
			----------####--------##--##--
			----------###-##------###--##-
			---------###----###---###--###
			--------####-----####-###--###
			---------##------###-###---###
			----------#------###----##-###
			-----------#-----###------###-
			------------#----###-----##-##
			-----------------###---######-
			-----------------###########--
			-----------------########-----
			---------------########-------
			-------------#######----------
			----------########------------
			---------######---------------
			--------#####-----------------
			--------##--------------------
			---------#--------------------
			----------#-------------------
						...


	ba symbol.h		prints an ascii representation of the bitmap
			file symbol.h (if no file is given it reads stdin)
			on stdout.  If symbol.h contained the following:

			#define pi_width 16
			#define pi_height 16
			static short pi_bits[] = {
			   0x0000, 0x0000, 0x4000, 0x7ffc,
			   0x3ffe, 0x0c32, 0x0c30, 0x0c30,
			   0x0c30, 0x0c30, 0x0c30, 0x0c30,
			   0x0c30, 0x0c30, 0x0000, 0x0000};

			then the ba command shown above would print

			#define width 16
			#define height 16

			----------------
			----------------
			--------------#-
			--#############-
			-#############--
			-#--##----##----
			----##----##----
			----##----##----
			----##----##----
			----##----##----
			----##----##----
			----##----##----
			----##----##----
			----##----##----
			----------------
			----------------

			This is particularly handy when looking at individual
			characters in a font (or worse yet, when you have to
			edit a font without bitmap).


	ba -a symbol.a		converts from ascii representation to bitmap
			format.  Thus the following is basically a nop:

				cat symbol.h | ba | ba -a

			This makes translating fonts between different formats
			or building fonts from textual descriptions very easy.
			With clever use of "tr" and "sed" you can do some 
			pretty amazing things.

	scalefont 6x10 1 12x20 2	Makes a new font directory called 12x20
			that contains a profile and empty characters for a font
			that is 2/1 the size of the font in 6x10.  You still
			have to do the hard part of putting the bits in the
			right place but in simple cases this can actually be
			done using ba and some cleverness with sed.

	displayfile textfile newhelv12b	Reads in lines of text from textfile
			and displays them using the broken up font in
			./newhelv12b.


Anyway this has been tremendously useful to us.  Hopefully with X.V11 there
will be a complete set of font management tools....  

							Jim 
						
