Randall Sawyer  <srandallsawyer[at]yahoo.com>   2006.12.1

The contents of this file are a first working draft.  If there is a sizable demand for CSG fonts among the POVRay community, then it would help if the fonts and the tools for formatting them stay compatible with eachother.  So, I'm establishing this preliminary standard.

Any questions, comments or suggestions are welcome at the above address.

********************************************************************
************ Constructive-Solid-Geometry Font Standards ************
********************************************************************

1.  A CSG Font consists of two components:

        * an array of CSG's
        * an array of floating point numbers

Both arrays have the same number of elements.  The first array stores a CSG for each character in the font.  The second array stores a value for the width of each character in the first array.  Each width value includes any padding space before the next character - just as any computer font includes whitespace as part of a character's width.

It is preffered that each array be generated by a macro;  However, explicitly declared font arrays are permitted as long as they are in compliance with standard 2. (see below)

2.  In order to remain consistant with the POVRay environment, CSG characters should behave as much like their 'text'-based counterparts.  This means that if a CSG font character is called by itself, then its default size and position would be the same as that of the traditional character.  What does that mean?

Say that your CSG array is named 'my_csg_font' and that it has 'n' CSG elements.  Lets call your widths array 'my_font_widths' (also with 'n' float values).  Assume that 'i' is any integer from 0 to n-1.

Then all of the follwing must be true:

    min_extent(my_csg_font[n]) = <0, 0, z0>,
    max_extent(my_csg_font[n]) = <x1, y1, z1>,
    x1 <= my_font_widths[n],
    y1 <= 1,
    -1 <= z0,
    z0 <= z1,
    z1 <= 1, and
    (z1 - z0) <= 1.

For a CSG font to meet these standards, these statements must be true for every CSG member of the font.

3.  A CSG font tool is a macro which must take ( but is not limited to ) the two arrays and a string as parameters.  Every CSG font tool uses the POVRay command 'asc()' to access the members of the font's arrays via the ascii value of each character in the string parameter.
