Symbol is stored as text file (one file for each symbol) in GISDBASE/etc/symbol/group/name or mapset/symbol/group/name S_read() searches first in mapsets and then in GISDBASE (symbol in GISDBASE may be overwritten by symbol of the same group/name in mapset) File format example: VERSION 1.0 BOX -10 -10 10 10 STRING LINE 0 -10 0 10 END END Symbol file is composed of objects, each object starts by keyword and ends by new line or 'END'. Some objects may contain another objects. - Drawing is composed of STRINGS and POLYGONS. - POLYGONS are composed of RINGS, first ring is outer (clockwise for now), following rings are inner (counter clockwise currently). - STRINGS and RINGS are composed of LINES and ARCS. STRINGS and POLYGONS are drawn by default (specified as module option like d.vect color=) color and fill color. This color may be over written by COLOR and FCOLOR. ---- DESCRIPTION OF OBJECTS ---- In following description is used N - integer number R G B - RGB color as 3 numbers 0-255 X,Y - coordinates (double) VERSION N.N Version number BOX X Y X Y Bounding box. Lower left and upper right corner. Larger side of box is taken as 1 for symbol scaling. That means that if size of box is 10 x 5, and scale in application is 2, all geometry will be multiplied by: 2 / 10. Origin of symbol is 0,0. COLOR NONE | R G B Color used for string or outline of polygon. If NONE is used, polygone outline is not drawn. FCOLOR NONE | R G B Fill color used for polygon. If NONE is used, polygone is not filled. LINE X Y X Y [X Y] END Line constructed from coordinate pairs. ARC X Y R A1 A2 [C] Arc specified by center (X Y), radius (R), start/end angle (A1/A2) and oprionaly direction (C for clockwise, default counter clockwise) STRING [COLOR R G B] LINE | ARC [LINE | ARC] END String composed of any number of lines and/or arcs. RING LINE | ARC [LINE | ARC] END Ring composed of any number of lines and/or arcs. Ring is automaticaly closed by line from last point to first point POLYGON [COLOR R G B] [FCOLOR R G B] RING [RING] END Polygon composed of any number of rings. First ring is outer (clockwise) and others are inner (counterclockwise). ------------------------------------ Note: restriction for clockwise/counter clockwise rings should be removed later and replaced by reordering in symbol library. Order is required by ps.map because PS uses even-odd rule for polygon filling. Internal structure: A symbol read into memory is stored in structure SYMBOL containing array of parts (SYMBPART). Part may be of type S_STRING or S_POLYGON, and contains array of chains (SYMBCHAIN) where both STRING or POLYGONS are stored. One chain contains array of elements (SYMBEL).