wmii/img/mkfile

45 lines
1.0 KiB
Plaintext
Raw Normal View History

2007-05-10 22:30:22 +04:00
MKSHELL=rc
path=$PLAN9/bin $path
eps = wmii.eps
2010-10-08 00:31:41 +04:00
calc = rc -c 'echo 4k $* p | dc}
2007-05-10 22:30:22 +04:00
2010-10-08 00:31:41 +04:00
iconwidth = 16
imagewidth = 154
2007-05-10 22:30:22 +04:00
2010-10-08 00:31:41 +04:00
%.pdf: %.eps
sh epstopdf $stem.eps
%-small.png: %.eps
epsbox = `{sed -n '/^%%BoundingBox:/{s/.*://p; q;}' $stem.eps}
iconscale = `{*=$epsbox; $calc $iconwidth $3 $1 -/}
iconheight = `{*=$epsbox; $calc $4 $2 - $iconscale '*'}
2008-02-03 23:06:26 +03:00
* = `{hoc -e'-('$epsbox')'}
x = $1
y = $2
2010-10-08 00:31:41 +04:00
gs -q -dBATCH -dNOPAUSE -s'DEVICE=pngalpha' -s'OutputFile='$target -g$iconwidth^x^$iconheight - <<!
2008-02-03 23:06:26 +03:00
$iconscale $iconscale scale
$x $y translate
($eps) run
showpage
quit
!
optipng -fix $target
2008-02-03 23:06:26 +03:00
2010-10-08 00:31:41 +04:00
%.png: %.eps
epsbox = `{sed -n '/^%%BoundingBox:/{s/.*://p; q;}' $stem.eps}
imagescale = `{*=$epsbox; $calc $imagewidth $3 $1 -/}
imageheight = `{*=$epsbox; $calc $4 $2 - $imagescale '*'}
2008-01-18 23:05:45 +03:00
* = `{hoc -e'-('$epsbox')'}
x = $1
y = $2
2010-10-08 00:31:41 +04:00
gs -q -dBATCH -dNOPAUSE -s'DEVICE=pngalpha' -s'OutputFile='$target -g$imagewidth^x^$imageheight - <<!
$imagescale $imagescale scale
2007-05-10 22:30:22 +04:00
$x $y translate
($eps) run
showpage
quit
!
optipng -fix $target
2007-05-10 22:30:22 +04:00