#!/usr/bin/perl -w
# Convert a standard/display drawing into production line drawing
&setStrokeWidth(0.1);
&startBackgroundComment();
&stopBackgroundComment();
while(<STDIN>) { print; } # dump rest of file

#-------------------------------------------------------------

sub setStrokeWidth() {
    local ($sw) = @_;

    while(<STDIN>) {
	if (m/stroke-width:/) {
	    s/stroke-width:[.0-9]+;/stroke-width:$sw;/;
	    print;
	    return;
	}
	print;
    }
}

sub startBackgroundComment() {
    while(<STDIN>) {
	if (m/desc.background/) {
	    s/desc.background/!-- desc>background/;
	    print;
	    return;
	}
	print;
    }
}

sub stopBackgroundComment() {
    while(<STDIN>) {
	if (m/path.+\/\>/) {
	    s/\/\>/\/ -->/;
	    print;
	    return;
	}
	print;
    }
}

