summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/metapost/featpost/bashscript/simpleviewer.sh
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/doc/metapost/featpost/bashscript/simpleviewer.sh')
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/bashscript/simpleviewer.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/metapost/featpost/bashscript/simpleviewer.sh b/Master/texmf-dist/doc/metapost/featpost/bashscript/simpleviewer.sh
new file mode 100644
index 00000000000..4cef12f11fb
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/bashscript/simpleviewer.sh
@@ -0,0 +1,15 @@
+prefwidth=640
+prefheigh=480
+prefratio=$(( 1000 * $prefwidth / $prefheigh ))
+tmpfilename=`mktemp simpleviewer.XXXXXX`
+epstopdf --nogs $1 > $tmpfilename
+epswidth=`identify $tmpfilename | cut -d " " -f 3 | cut -d x -f 1`
+epsheigh=`identify $tmpfilename | cut -d " " -f 3 | cut -d x -f 2`
+aspectra=$(( 1000 * $epswidth / $epsheigh ))
+if test $aspectra -ge $prefratio
+then resol=$(( 72 * $prefwidth / $epswidth ))
+else resol=$(( 72 * $prefheigh / $epsheigh ))
+fi
+echo " Resolution:" $resol "dpi."
+gs -q -r$resol -sDEVICE=x11 -dTextAlphaBits=4 -dGraphicsAlphaBits=4 $tmpfilename
+rm $tmpfilename \ No newline at end of file