Debian Codegraph @

PROBLEMS

raw
1 These release notes list minor problems with the GNU libplot graphics
2 library, and with the sample command-line utilities `graph', `plot',
3 `tek2plot', `plotfont', and `pic2plot', which are built on it. We classify
4 them as problems rather than bugs.
5
6 Most of them are due to idiosyncrasies of (or bugs in) the display devices
7 and application software that libplot must produce output for.
8
9 See also the file ./COMPAT, for some changes in this release that are
10 relevant to the below problems.
11
12 ======================================================================
13
14 The libplot SVG driver and `graph -T svg'
15 -----------------------------------------
16
17 The SVG specification is to some extent a moving target; consult the W3
18 Consortium's Web pages on SVG ( http://www.w3.org/Graphics/SVG ) for more
19 information. In this release, the SVG produced by libplot's SVG driver
20 complies with the SVG 1.1 specification.
21
22 However, as of this writing, some SVG viewers fail to implement crucial
23 parts of the specification (especially, those dealing with text). So, the
24 following sorts of problem may be encountered when viewing SVG output.
25
26 1. The font used for a text string may not be the one you have selected.
27 libplot's SVG driver attempts to give the SVG viewer enough information to
28 select an appropriate font. For example, `graph -T svg' by default uses a
29 Helvetica font. Its SVG output contains the font specification
30
31 font-family:'Helvetica',sans-serif;
32
33 Similarly, if a Times-Bold font is to be used, the SVG output contains the
34 font specification
35
36 font-family:Times-Bold,'Times Roman',serif; font-weight:bold
37
38 In all cases, both the font's family name and its Postscript name, if
39 different, will be supplied in the SVG output. In nearly all cases, a
40 `generic name' such as `serif' will be supplied too. However, some SVG
41 viewers have been observed to fail to retrieve a matching font, or any font
42 at all (!), even when they are helped out in this way.
43
44 One workaround for this problem is to use a builtin Hershey (stroked) font,
45 such as HersheySerif or HersheySans. (For more information on this, see
46 the file ./COMPAT.) Type `graph -Tsvg --help-fonts' to get a complete list
47 of fonts available to you, when producing SVG output.
48
49 2. If you switch fonts in the middle of a text string, the substrings may
50 not line up properly. If this occurs, it is because your SVG viewer is
51 using fonts whose metrics are different from what libplot's SVG driver
52 expects. SVG supports the creation of compound (multi-font) text strings,
53 via <tspan>..</tspan> constructs. However, libplot's SVG driver does not
54 currently use these constructs. Support for them may be added to later
55 releases of the driver.
56
57 Again, the fix is to use one of the builtin Hershey fonts, such as
58 HersheySerif.
59
60 ----------------------------------------------------------------------
61
62 The libplot X driver and `graph -T X'
63 -------------------------------------
64
65 1. The Symbol and ZapfDingbats fonts distributed with some X Window System
66 displays, such as recent releases of XFree86, are incorrectly encoded. In
67 consequence, text strings that contain Greek characters or mathematical
68 symbols may not be displayed correctly.
69
70 To check the encoding of the Symbol font, do both
71
72 plotfont -T X Symbol
73 plotfont -T ps Symbol | gv -
74
75 to display respectively the layout of the Symbol font in your X display,
76 and the standard Postscript symbol font build into the `gv' application.
77 (To see the latter, you could alternatively send the output of
78 `plotfont -T ps Symbol' to a Postscript printer.) If the two character
79 tables look different, complain to the people who supplied your X Window
80 System software.
81
82 ----------------------------------------------------------------------
83
84 The libplot PS driver and `graph -T ps'
85 ---------------------------------------
86
87 1. There are a lot of buggy Postscript interpreters out there. If you
88 switch fonts in the middle of drawing a label with `graph -T ps', or when
89 drawing a multi-font string with libplot's PS driver, and the sub-strings
90 don't match up properly when you view the result, it may very well be the
91 fault of your interpreter. Even for the 35 standard Postscript fonts, some
92 vendors don't agree with Adobe as to the width of the printable `8-bit'
93 (non-ASCII) characters. Sun SparcPrinters in particular have been observed
94 to space such characters incorrectly.
95
96 2. It has been reported that the freeware `bbfig' program, which is
97 sometimes used for computing the bounding boxes of Postscript files, does
98 not necessarily compute the correct bounding box when it is applied to the
99 output of libplot's PS driver; for example, to a graph produced by
100 `graph -T ps'.
101
102 The bug here is in bbfig, not in libplot. You should never need to run
103 `bbfig' on Postscript files produced by this package, since they already
104 contain accurate bounding boxes.
105
106 3. As seen by the idraw drawing editor, a Postscript file produced by
107 `graph -T ps' or libplot's PS driver will have its colors quantized. Both
108 pen color and fill color will be quantized.
109
110 These quantizations are due to limitations of idraw. Line widths will be
111 quantized too, since the width of a line in idraw must be an integer number
112 of printer's points.
113
114 No such quantizations will take place if the Postscript file is viewed with
115 a Postscript interpreter such as Ghostscript, sent directly to a printer,
116 or included in another document.
117
118 4. If you use the Postscript Plotter support in libplot/libplotter to draw
119 a self-intersecting filled path, and you specify that the `nonzero winding
120 number rule' should be employed to determine which regions are inside and
121 which are outside the path, the resulting Postscript file will look all
122 right when previewed or printed. But if you use `idraw' to view it
123 or edit it, the other rule (the `odd winding number rule') will be used.
124
125 The problem is due to `idraw', which does not currently understand the
126 nonzero winding number rule.
127
128 5. [Relevant only if configuration used the --enable-lj-fonts option.]
129 If you use `idraw' to edit a Postscript file prepared with `graph -T ps'
130 or libplot's PS driver that contains text in the Wingdings font, some of
131 the Wingdings characters will be incorrectly interchanged.
132
133 This problem is due to idraw, which does not know that Wingdings is not an
134 ISO-Latin-1 font. The fix is to use a text editor to remove the line
135
136 /Tidbits reencodeISO def
137
138 from the edited Postscript file. (The plotting utilities refer to
139 Wingdings internally as `Tidbits'.)
140
141 ----------------------------------------------------------------------
142
143 The libplot CGM driver and `graph -T cgm'
144 ----------------------------------------
145
146 1. There are many older CGM viewers and interpreters, such as the free but
147 unsupported(?) RALCGM and GPLOT viewers, and the CGM import filter used by
148 Microsoft Office, that can only handle version 1 CGM files. To produce
149 output for such CGM viewers and interpreters, you should set the
150 environment variable (i.e., libplot parameter) CGM_MAX_VERSION to "1".
151
152 The default is to use version 3. (Versions are more or less upward
153 compatible, so any version-1 CGM file is effectively also a version-3 file,
154 but not vice versa.) However, no free (open-source) version-3 CGM viewer
155 is currently available. A high-quality browser plug-in for version-3 CGM
156 files, without source, is available from http://www.sysdev.com .
157
158 You should be aware that version 1 was much less powerful than later
159 versions, such as version 3. In particular, font handling was not good.
160 Any text string in a CGM file produced by libplot is accompanied by an
161 `extent box' which the string is automatically adjusted to fit, by any CGM
162 viewer or interpreter. That is the case for all versions of the CGM
163 format, including version 1. Unfortunately, in version 1, what it meant
164 for the string to `fit' was not properly specified. Another problem with
165 version 1 format was that there was no way of specifying font properties,
166 such as oblique-vs.-upright, boldface-vs.-regular, etc. So when a font is
167 unavailable, the substituted font is often inappropriate.
168
169 When producing a version-1 CGM file with the plotting utilities or libplot,
170 Hershey fonts may be the best fonts to use. Any text string in a Hershey
171 font is drawn into a CGM output file not as a CGM text string, but as a
172 collection of polygonal lines, which should be rendered acceptably. To use
173 a Hershey font, you could specify the `-F HersheySerif' option, for
174 example, when you run `graph -T cgm'.
175
176 2. If a binary-encoded CGM output file produced by libplot's CGM driver
177 contains any single text string that is longer than about 2000 characters,
178 the RALCGM viewer will not be able to parse the CGM file correctly. In
179 fact, RALCGM may crash. The problem is in RALCGM, not in libplot. This
180 bug is not a major problem, since such extraordinarily long text strings
181 almost never occur.
182
183 3. If a CGM output file produced by libplot's CGM driver contains any text
184 string for which the font size is effectively zero, the RALCGM viewer will
185 not be able to display the CGM file correctly. In fact, RALCGM may crash.
186 You can verify this by doing
187
188 echo 0 0 1 1 2 0 | \
189 CGM_MAX_VERSION=1 graph -T cgm --font-size 0.000000001 | ralcgm -dx
190
191 When you attempt to view the output file, you will probably get a
192 segmentation fault. But the bug is in RALCGM, not in libplot.
193
194 4. There are some commercial viewers and interpreters which are advertised
195 as able to handle version-3 CGM files, but which in fact cannot do so. The
196 CGM import filter used by Adobe Illustrator (as of version 7.0, at least)
197 is in this category. It does not recognize the so-called custom line
198 styles (i.e., dashing patterns) that version-3 CGM files may include. In
199 fact, if it sees a definition of a custom line style in a CGM file that it
200 is importing, it may stop functioning or crash! Fortunately, CGM files
201 produced by `graph -T cgm' use only CGM's default line styles; not custom
202 ones. `pic2plot -T cgm' and the libplot functions `linedash()' and
203 `flinedash()' do generate custom line styles.
204
205 Actually, even if CGM_MAX_VERSION is set equal to "1", so that custom CGM
206 line styles are not used, there is still a problem with importing CGM files
207 into Illustrator. When it imports a CGM file, of whatever version,
208 Illustrator-7.0 maps all default CGM line styles to "solid". That is,
209 dotted lines, dashed lines, etc., all appear as solid lines. So the output
210 of `graph -T cgm -m 0', `graph -T cgm -m 1', `graph -T cgm -m 2', etc.,
211 will look alike. There seems to be no way around this.
212
213 Since Illustrator's CGM import filter is so buggy, it is recommended that
214 when generating a graphics file for import into Illustrator, rather than
215 generating a CGM file, you use the `-T ai' option to generate Illustrator's
216 native format. Whether this is necessary for the most recent versions of
217 Illustrator (8.0 and 9.0) has not been checked.
218
219 5. As noted, some CGM viewers provide only partial support for the modern
220 version-3 CGM file format. When dealing with such a viewer, it may be
221 useful for you to know which CGM primitives are output by libplot's CGM
222 driver. A list appears in the file libplot/README-cgm. If you have full
223 documentation on the CGM primitives supported by your viewer, the list
224 should help you decide whether it is necessary to reduce the CGM version
225 number from 3 to 2, or to 1.
226
227 ----------------------------------------------------------------------
228
229 The libplot xfig driver and `graph -T fig'
230 ----------------------------------------
231
232 1. At least in some versions of xfig release 3.2, the `fig2dev' program
233 that `xfig' uses to export figures in Postscript format has a bug. It
234 incorrectly transforms minus signs to hyphens, and hyphens to en-dashes.
235
236 For example, if you do `plotfont -Tfig --box Helvetica' and
237 `plotfont -Tfig --box -2 Helvetica' to produce character maps of the two
238 halves of the Helvetica font, and then use xfig 3.2 to export the two
239 character maps in Postscript format, you will notice that in the exported
240 character maps, the minus sign and hyphen do not fit properly within their
241 boxes. That is because they have been replaced by a hyphen and an en-dash,
242 respectively.
243
244 This is a problem with `fig2dev', not libplot. If you encounter this
245 problem, a possible workaround is to change, with a text editor, the string
246 "8#255 /endash" in the exported PS file to "8#255 /hyphen 8#055 /minus".
247 The problem has been reported to the xfig maintainer, and may now have been
248 fixed.
249
250 2. xfig supports rotation and uniform scaling of the 35 standard Postscript
251 fonts, but not non-uniform scaling or shearing. So libplot's xfig driver
252 automatically replaces anisotropically transformed Postscript fonts by a
253 default Hershey font (HersheySerif). Hershey fonts may always be
254 anisotropically transformed.
255
256 This affects `graph -T fig', `plotfont -T fig', etc., and in general the
257 output of libplot's xfig driver, if you specify a rectangular (rather than
258 square) viewport. For example, if you do
259
260 echo 0 0 1 1 2 0 | graph -T fig --page-size letter,xsize=8in,ysize=4in
261
262 then in the .fig file which is written to standard output, the usual
263 Helvetica font for graph labels will be replaced by HersheySerif. You will
264 get a warning message about that.
265
266 ----------------------------------------------------------------------
267
268 libplot's PCL 5 and HP-GL/2 drivers, and `graph -T pcl' and `graph -T hpgl'
269 -----------------------------------------------------------------------
270
271 The following remarks apply when producing either PCL 5 or HP-GL/2 output.
272 That's because PCL 5 output produced by libplot and the plotting utilities
273 is really HP-GL/2 output, preceded by an escape sequence that switches the
274 printer into HP-GL/2 mode. (It's followed by an escape sequence that
275 switches the printer back to PCL 5 mode.)
276
277 1. The default treatment of colors in PCL 5 and HP-GL/2 output is not
278 optimal, because the basic HP-GL/2 drawing model is not very powerful.
279 HP-GL/2 supports a set of seven `logical pens', whose colors are black,
280 red, green, yellow, blue, magenta, and cyan. Any line or curve can be
281 drawn by any of the pens, and any region bounded by a curve can be filled,
282 to any specified intensity (quantized in units of 10% or so) by any pen
283 color. And that's just about it: in the basic drawing model, those are the
284 only pen colors and fill colors that can be produced.
285
286 The situation is even worse than it sounds, because when PCL 5 or HP-GL/2
287 output is directed to a monochrome display device such as an HP LaserJet,
288 every pen (even the yellow pen) is drawn as black!
289
290 Fortunately, color PCL 5 and HP-GL/2 devices, such as color LaserJets and
291 DesignJet plotters, support an enhanced drawing model. They can assign
292 arbitrary colors to the logical pens. When producing PCL 5 or HP-GL/2
293 output for such devices, you should set the environment variable
294 PCL_ASSIGN_COLORS (or HPGL_ASSIGN_COLORS, as the case may be) to "yes".
295 That will significantly improve the rendering of colored plots.
296
297 2. Internally, the LaserJet 4L and 5L use a number for the Wingdings font
298 that is different from the number used by other LaserJets. (That's because
299 they use an Intellifont version of the font, rather than a TrueType
300 version.) So if any PCL 5 output that uses the Wingdings font is sent to a
301 4L or a 5L from `graph -T pcl' or any other of the plotting utilities, it
302 won't print correctly.
303
304 If you need to work around this problem, you can search for the number
305 `31402' in the file libplot/g_fontd2.c, change it to `6826', and recompile.
306 PCL 5 output will then use the typeface ID that is appropriate for the 4L
307 and 5L.
308
309 A less drastic remedy is to do a search-and-replace on the PCL 5 output
310 with a text editor, replacing each occurrence of the string "31402" by
311 "6826".
312
313 The above advice probably applies to the LaserJet 6L as well as the 4L and
314 5L, but that hasn't been checked.
315
316 3. There are some small errors in the positioning of text strings when
317 producing PCL 5 or HP-GL/2 output that uses the Symbol font. For example,
318 if you do `plotfont -Tpcl --box Symbol > symbol.pcl' to get a PCL 5 file
319 that is a character map of the Symbol font, you will notice that in the
320 character map, some of the characters do not quite line up with their boxes.
321
322 This problem is due to problems in HP's documentation. HP has released
323 useful information on its 45 LaserJet fonts. (This includes font metrics,
324 etc.; see ./INSTALL.fonts.) However, their information on the Symbol font
325 appears to be incorrect. As a consequence, horizontal positioning of text
326 strings in the Symbol font is slightly in error. This problem does not
327 affect the 44 other LaserJet fonts.
328
329 ----------------------------------------------------------------------
330
331 libplot's ReGIS driver and `graph -T regis'
332 -------------------------------------------
333
334 `graph -T regis' (along with libplot's ReGIS driver, which it uses)
335 currently contains incomplete support for the filling of regions. If the
336 region to be filled extends beyond the edge of the ReGIS display, ideally
337 it should be clipped, then filled. At present, filling is not performed at
338 all (since the clipping code has not yet been written).
339
340 In normal operation, this problem should not affect the output of `graph -T
341 regis' at all. But it is really a bug, not just a problem.
342
343 `graph -T regis' also does not support the 35 standard Postscript fonts;
344 the Hershey fonts must be used instead. (The default font is HersheySerif
345 rather than Helvetica.) The fact that the ZapfDingbats font is not
346 supported means that `graph -T regis' does not support marker symbols
347 greater than or equal to 32, or more accurately it does not select them
348 from the font (ZapfDingbats) that one would expect.
349
350 ----------------------------------------------------------------------
351
352 libplot's Tektronix driver and `graph -T tek'
353 ---------------------------------------------
354
355 `graph -T tek' (along with libplot's Tektronix driver, which it uses) does
356 not support the filling of regions, so the -q option does not work; also,
357 multiplotting, which normally `blanks out' regions by filling them with
358 white, may result in messy-looking plots. `graph -T tek' also does not
359 support the 35 standard Postscript fonts; the Hershey fonts must be used
360 instead. (The default font is HersheySerif rather than Helvetica.) The
361 fact that the ZapfDingbats font is not supported means that `graph -T tek'
362 does not support marker symbols greater than or equal to 32, or more
363 accurately it does not select them from the font (ZapfDingbats) that one
364 would expect.
365
366 Filling of regions is not supported because Tektronix storage tubes did not
367 support filling, for obvious reasons. The Tektronix emulator in the MS-DOS
368 version of kermit apparently supports a restricted sort of region filling,
369 but there are currently no plans to extend libplot's Tektronix driver to
370 use it.
371
372 The 35 Postscript fonts could in principle be supported by libplot's
373 Tektronix driver, if Type 1 or TrueType rasterizer code were added to
374 libplot. There are plans for doing this. But most people are interested
375 in using such a driver to produce bitmaps for the Web, not in using it to
376 draw Type 1 or TrueType fonts on Tek displays. (The phrase "bolting a V-8
377 onto a Model T" comes to mind.)
378
379 In `graph -T tek' the `--line-width' and `--frame-line-width' options also
380 do not work, since the Tektronix driver does not support lines with other
381 than a default width (it also does not support the setting of `cap mode'
382 and `join mode' for polylines).
383
384 A final comment. The Tektronix emulator in xterm(1) has a curious feature
385 (bug?) that no one seems to have commented on. When any line of type other
386 than "solid" (i.e. "dotted", "dotdashed", "shortdashed", "longdashed") is
387 drawn, the pattern of illuminated and non-illuminated pixels along the line
388 is the opposite of what one would expect. So "dotted" lines (obtained
389 e.g. with the "-m 2" option to graph) look more like dashed lines. This
390 bug, if that's what it is, is easily fixed by changing the xterm source code.
391
392 ======================================================================
393
394 Problems with thick lines drawn with libplot
395 --------------------------------------------
396
397 A `line segment' is conceptually a rectangle (usually rather thin). But if
398 the affine transformation from user coordinates to device coordinates is
399 not a uniform expansion or contraction, most such rectangles should ideally
400 be sheared into parallelograms in the device frame. However, most display
401 devices cannot display sheared line segments: their `lines', no matter how
402 thick, are always drawn as rectangles.
403
404 X Windows does not support sheared thick lines. Nor do the xfig or idraw
405 drawing editors, or the HP-GL and HP-GL/2 languages. However, the
406 Postscript and SVG file formats do support them.
407
408 As a consequence, libplot's PS and SVG drivers are currently the only ones
409 that display sheared thick lines correctly. The problem is evident only
410 for unusually thick lines, of course.
411
412 A related problem is that a constant-width polyline (polygonal line) drawn
413 in the user frame should, ideally, be drawn in the device frame in an
414 unusual way: the thickness of each line segment should depend on direction.
415 I.e., some segments of a device-frame polyline should be thicker than
416 others. This too is supported only by libplot's PS and SVG drivers.