Randall Sawyer  <srandallsawyer[at]yahoo.com>   2006.12.2.08:42 UTC

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 each other.  So, I'm suggesting this preliminary standard.

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

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

1.  A CSG Font consists of two components:

        * an array of CSG objects
        * an array of floating point numbers (see note below)

Both arrays have the same number of elements.  The first array stores a CSG object for each character in the font.  The second array stores a value for the width of each character in the first array including any white space.  Each array may be generated by a macro or declared explicitly.

2.  Each CSG object in the first array must be constrained to the same bounding box as its default 'text{}'-generated counterpart.  Stated explicitly:  Given a CSG-object array called 'my_csg_font' with n members and a float array called 'my_font_widths', also with n elements, then all of the following statments must be true for every index i: 0 <= i < n.

  min_extent( my_csg_font[i] )  = <0, y0, 0>
  max_extent( my_csg_font[i] )  = <x1, y1, z1>
                            x1 <= my_font_widths[i]
                            -1 <= y0
                            y0 <= y1
                            y1 <= 1
                     (y1 - y0) <= 1
                            z1 <= 1

3.  A "CSG font-formatting macro" is defined as any macro which must take ( but is not limited to ) the CSG-object array and a string as parameters and which returns a CSG-object.  Such a macro must make use of the command 'asc()' to access the members of the font's CSG-object array via the ascii value of each character in the string parameter.

Note:  The array of floating point numbers is intended to accommodate proportional fonts.  In the case of a fixed font, this array can be replaced by a declared constant floating point number.
