/usr/share/inkscape/extensions/txt2svg.pl is in inkscape 0.48.5-3.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
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 | #!/usr/bin/perl
# This is a script to render a plain text file into SVG, line by line.
use strict;
use SVG;
use Encode;
use vars qw($VERSION);
$VERSION = '1.01';
binmode(STDOUT, ":utf8");
my $svg = new SVG;
$svg->comment('Generated by txt2svg');
my $i=0;
while (<>) {
chomp($_);
s/\t/ /g; # Convert tabs into spaces, otherwise we get errors about invalid char
my $text = $svg->text(id => "text_line_$i",
x => 10,
y => 12*(1+$i),
'xml:space' => 'preserve',
style => { 'font' => 'Courier',
'font-family' => 'Courier 10 pitch',
'font-size' => 10,
}
)
->cdata(decode_utf8($_));
$i++;
}
print $svg->xmlify();
|