File: g_dash2.c

package info (click to toggle)
plotutils 2.4.1-15
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 11,072 kB
  • ctags: 6,952
  • sloc: ansic: 76,305; cpp: 12,402; sh: 8,475; yacc: 2,604; makefile: 894; lex: 144
file content (55 lines) | stat: -rw-r--r-- 2,812 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/* This file defines GNU libplot's builtin line styles.  A line style is
   specified by invoking the linemod() operation.  The supported line
   styles are a superset of the line styles of traditional (Unix) libplot.

   Unix libplot originated at Bell Labs in the early 1970's, and the first
   supported display device was a Tektronix 611 storage scope.  The libplot
   API did not originally include linemod(), as the Unix Version 5 manual
   makes clear.  That is because the Tektronix 611 did not have any
   predefined set of line styles.  linemod() was added to the API slightly
   later, when it was extended to support the Tektronix 4010/4014 storage
   scope.  The 4010/4014 provided hardware support for the five line styles
   "solid" through "longdashed".

   GNU libplot supports the traditional five, and also two additional line
   styles, "dotdotdashed" and "dotdotdotdashed".  Each non-solid style is
   defined as a dash pattern, with the length of each dash (drawn or not
   drawn) being an integer multiple of the line width.  This `scaling by
   line width' applies for sufficiently wide lines, at least.

   GNU libplot also supports a special "disconnected" line style (if a path
   is disconnected, it's drawn as a sequence of filled circles, one at each
   of the path join points). */

#include "sys-defines.h"
#include "extern.h"

/* An array of dashes for each line style (dashes are cylically used,
   on/off/on/off...).  Styles must appear in a special order: it must agree
   with our internal numbering, i.e. must agree with the definitions of
   L_{SOLID,DOTTED,DOTDASHED,SHORTDASHED,LONGDASHED,DOTDOTDASHED etc.} in
   extern.h, which are 0,1,2,3,4,5 etc. respectively. */

const plLineStyle _line_styles[NUM_LINE_STYLES] =
/* Dash arrays for "dotted" through "longdashed" below are those used by
   the Tektronix emulator in xterm(1), except the emulator seems
   incorrectly to have on and off interchanged. */
{
  { "solid", 		L_SOLID, 		0, {0} 		}, /* dummy */
  { "dotted", 		L_DOTTED, 		2, {1, 3} 	},
  { "dotdashed", 	L_DOTDASHED, 		4, {4, 3, 1, 3} },
  { "shortdashed", 	L_SHORTDASHED, 		2, {4, 4} 	},
  { "longdashed", 	L_LONGDASHED, 		2, {7, 4} 	},
  { "dotdotdashed", 	L_DOTDOTDASHED,		6, {4, 3, 1, 3, 1, 3} },
  { "dotdotdotdashed", 	L_DOTDOTDOTDASHED,	8, {4, 3, 1, 3, 1, 3, 1, 3} }
};

/* N.B. `ps4014', the Tektronix->PS translator in Adobe's Transcript
   package, uses { 1, 2 }, { 8, 2, 1, 2 }, { 2, 2 }, { 12, 2 } for
   "dotted" through "longdashed", instead. */

/* N.B. a genuine Tektronix 4014 (with Enhanced Graphics Module) uses 
   { 1, 1 }, { 5, 1, 1, 1 }, { 3, 1 }, { 6, 2 } for "dotted"
   through "longdashed", instead.  See the Tektronix 4014 Service
   Instruction Manual (dated Aug. 1974) for the diode array that produces
   these patterns. */