#!/usr/bin/perl -wp -00 use Getopt::Std; use strict; use vars qw(%opts); BEGIN { %opts = ( y => 6, ); getopts('y:', \%opts); } my ($g_id, $p_opts, $t_opts, $t_str) = m#.*.*(.*?)#s; next unless $t_str; s#(.*?)#g; if ($#lines > 0) { foreach (@lines) { $_ = qq($_); } my ($y0) = - int($#lines/2)*$opts{y}; $lines[0] =~ s/dy="\d+"/dy="$y0"/; s|(.*?\s*)+|$1|s; $t_str = join("\n", @lines); # http://stackoverflow.com/questions/5185699/multiple-lines-of-curved-text-in-svg } s|.*?|$t_str|;