[rrd-developers] [patch] SVG-stringwidth, EPS, etc

Peter Speck speck at ruc.dk
Sat Apr 6 17:54:41 MEST 2002


Hi,

Updated patches for SVG stringwidth (using AFM files) and support for 
EPS output.

3 patches, #3 depends on #1 as EPS uses AFM for stringwidth too.

1) http://www.vitality.dk/rrdtool/patches/2002-04-06-svg2.diff
src/rrd_afm.[ch], src/rrd_afm_data.[ch] and changes to rrd_gfx.[ch] to 
use AFM for stringwidth in SVG output.

2) http://www.vitality.dk/rrdtool/patches/2002-04-06-libafm.diff
Creates libraries/afm with .afm files for the standard 14 postscript 
fonts and perl script to create src/rrd_afm_data.c Includes small test 
program to show examples of calculated stringwidth and actual 
stringwidth.

3) http://www.vitality.dk/rrdtool/patches/2002-04-06-eps.diff
Adds EPS output support.
Modifies rrd_tool.c as rrd_graph() changes the argv pointer, and 
rrd_tool then always wrote the 200x100 output line to the file (which 
probably doesn't do anything for png images, but eps files fail having 
it after the %%EOF marker).

I've started looking at PDF, but it will take some time as spring has 
started and we have a "Night Film Festival" currently.

Old text:
To reduce runtime overhead for using AFM files I have chosen to encode 
them as constant C globals instead of parsing the files at runtime. This 
is done by the perl script compile_afm.pl which parses the afm files and 
generates src/rrd_afm_data.c   The format is documented in rrd_afm_data.h

All the font data and the perl script are stored in a new directory: 
libraries/afm. Adobe allows distribution and modification of the *.afm 
files as long as the copyright message is not changed.

The files have the generic afm names: rrd_afm.h/c and rrd_afm_data.h/c 
as the afm font info will be useful for implementing EPS/PDF formats as 
they use the same font metrics.

Users can add their own fonts, run the perl script and recompile 
rrdtool. The included set of fonts are required by all postscript (like) 
devices so users can count on having them in their printer/viewer. I use 
"Helvetica" as default, so that one should stay, all others can be 
removed to save space. The perl script uses all the .afm files in the 
directory.

----
  - Peter Speck

		When the going gets weird, the weird turn pro.
		(unknown)


--
Unsubscribe mailto:rrd-developers-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:rrd-developers-request at list.ee.ethz.ch?subject=help
Archive     http://www.ee.ethz.ch/~slist/rrd-developers
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the rrd-developers mailing list