1
0
mirror of git://projects.qi-hardware.com/ben-wpan.git synced 2025-04-21 12:27:27 +03:00

Merged the functionality of gitsch2ppm into schhist2web.

- scripts/normalizeschps: don't edit in place and thus become capable of
  running in a pipe
- scripts/schps2ppm: considered - to be an option and thus didn't accept
  it as input file name
- scripts/schhist2web: open-coded functionality of "gitsch2ppm"
- scripts/gitsch2ppm: removed
This commit is contained in:
Werner Almesberger
2010-08-30 02:53:41 -03:00
parent b3f2014863
commit 800577353e
4 changed files with 35 additions and 109 deletions

View File

@@ -18,7 +18,7 @@ LINEWIDTH=120
usage()
{
cat <<EOF 1>&2
usage: $0 [options] file ...
usage: $0 [options] [in.ps [out.ps]]
-w points Postscript line width (default: $LINEWIDTH)
EOF
@@ -38,22 +38,24 @@ while true; do
esac
done
for n in "$@"; do
sed -i '
1c%!PS-Adobe-3.0\
currentdict /DidNormalize known not { \
/setlinewidth { '$LINEWIDTH' 2 copy lt { exch } if pop \
setlinewidth } bind def \
/rectfill { rectstroke } bind def \
/DidNormalize true def \
} if \
gsave
/%%DocumentMedia: A4.*/a-20 -10 translate
/%%DocumentMedia: A3.*/{s/A3/A4/;a-20 -10 translate 0.70 dup scale
}
/%%DocumentMedia: A2.*/{s/A2/A4/;a-18 -12 translate 0.49 dup scale
}
$agrestore' "$n"
done
[ -z "$3" ] || usage
in=${1:--}
out=${2:-/dev/stdout}
sed '
1c%!PS-Adobe-3.0\
currentdict /DidNormalize known not { \
/setlinewidth { '$LINEWIDTH' 2 copy lt { exch } if pop \
setlinewidth } bind def \
/rectfill { rectstroke } bind def \
/DidNormalize true def \
} if \
gsave
/%%DocumentMedia: A4.*/a-20 -10 translate
/%%DocumentMedia: A3.*/{s/A3/A4/;a-20 -10 translate 0.70 dup scale
}
/%%DocumentMedia: A2.*/{s/A2/A4/;a-18 -12 translate 0.49 dup scale
}
$agrestore' "$in" >"$out"
# /%%Orientation: Landscape/d' "$n"