1 /* This file is part of the GNU plotutils package.  Copyright (C) 1995,
2    1996, 1997, 1998, 1999, 2000, 2005, 2008, Free Software Foundation, Inc.
3 
4    The GNU plotutils package is free software.  You may redistribute it
5    and/or modify it under the terms of the GNU General Public License as
6    published by the Free Software foundation; either version 2, or (at your
7    option) any later version.
8 
9    The GNU plotutils package is distributed in the hope that it will be
10    useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
11    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12    General Public License for more details.
13 
14    You should have received a copy of the GNU General Public License along
15    with the GNU plotutils package; see the file COPYING.  If not, write to
16    the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor,
17    Boston, MA 02110-1301, USA. */
18 
19 /* This file defines GNU libplot's builtin line styles.  A line style is
20    specified by invoking the linemod() operation.  The supported line
21    styles are a superset of the line styles of traditional (Unix) libplot.
22 
23    Unix libplot originated at Bell Labs in the early 1970's, and the first
24    supported display device was a Tektronix 611 storage scope.  The libplot
25    API did not originally include linemod(), as the Unix Version 5 manual
26    makes clear.  That is because the Tektronix 611 did not have any
27    predefined set of line styles.  linemod() was added to the API slightly
28    later, when it was extended to support the Tektronix 4010/4014 storage
29    scope.  The 4010/4014 provided hardware support for the five line styles
30    "solid" through "longdashed".
31 
32    GNU libplot supports the traditional five, and also two additional line
33    styles, "dotdotdashed" and "dotdotdotdashed".  Each non-solid style is
34    defined as a dash pattern, with the length of each dash (drawn or not
35    drawn) being an integer multiple of the line width.  This `scaling by
36    line width' applies for sufficiently wide lines, at least.
37 
38    GNU libplot also supports a special "disconnected" line style (if a path
39    is disconnected, it's drawn as a sequence of filled circles, one at each
40    of the path join points). */
41 
42 #include "sys-defines.h"
43 #include "extern.h"
44 
45 /* An array of dashes for each line type (dashes are cylically used,
46    on/off/on/off...).  Types must appear in a special order: it must agree
47    with our internal numbering, i.e. must agree with the definitions of
48    L_{SOLID,DOTTED,DOTDASHED,SHORTDASHED,LONGDASHED,DOTDOTDASHED etc.} in
49    extern.h, which are 0,1,2,3,4,5 etc. respectively. */
50 
51 const plLineStyle _pl_g_line_styles[PL_NUM_LINE_TYPES] =
52 /* Dash arrays for "dotted" through "longdashed" below are those used by
53    the Tektronix emulator in xterm(1), except that the emulator seems
54    incorrectly to have on and off interchanged (!). */
55 {
56   { "solid", 		PL_L_SOLID, 		0, {0} 		}, /* dummy */
57   { "dotted", 		PL_L_DOTTED, 		2, {1, 3} 	},
58   { "dotdashed", 	PL_L_DOTDASHED, 	4, {4, 3, 1, 3} },
59   { "shortdashed", 	PL_L_SHORTDASHED,	2, {4, 4} 	},
60   { "longdashed", 	PL_L_LONGDASHED, 	2, {7, 4} 	},
61   { "dotdotdashed", 	PL_L_DOTDOTDASHED,	6, {4, 3, 1, 3, 1, 3} },
62   { "dotdotdotdashed", 	PL_L_DOTDOTDOTDASHED,	8, {4, 3, 1, 3, 1, 3, 1, 3} }
63 };
64 
65 /* N.B. `ps4014', the Tektronix->PS translator in Adobe's Transcript
66    package, uses { 1, 2 }, { 8, 2, 1, 2 }, { 2, 2 }, { 12, 2 } for
67    "dotted" through "longdashed", instead. */
68 
69 /* N.B. A genuine Tektronix 4014 (with Enhanced Graphics Module) uses
70    { 1, 1 }, { 5, 1, 1, 1 }, { 3, 1 }, { 6, 2 } for "dotted"
71    through "longdashed", instead.  See the Tektronix 4014 Service
72    Instruction Manual (dated Aug. 1974) for the diode array that produces
73    these patterns. */
74