#!/usr/local/bin/perl

# 
# gplinebold: Gnuplot から出力された PS ファイルの線幅増・カラー化
# 
#     [2002/06/27] OSHIRO Naoki.
# 

require "getopts.pl";
&Getopts("lcSh"); # l:line width c:color enable S:solid off h:help

if ($opt_h) {
    print STDERR "gplinebold [-l line width] [-c] [-S] [infile]\n";
    exit;
}

$lw=20;
$lw=$opt_l if ($opt_l);

while (<>) {
    $_="$1 $lw def$'" if m#^(/gnulinewidth) .+ def#;
    $_="$1 true def$'" if ($opt_c && m#^(/Color) .+ def#);
    $_="$1 true def$'" if ($opt_c && !$opt_S && m#^(/Solid) .+ def#);
    print;
}
