aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/xface2xbm.in
diff options
context:
space:
mode:
authorFumitoshi UKAI <ukai@debian.or.jp>2002-03-14 16:12:02 +0000
committerFumitoshi UKAI <ukai@debian.or.jp>2002-03-14 16:12:02 +0000
commit739eb5f7ab4d8d10e054ba80813bc1d9e3307450 (patch)
tree16824ac9f18cd2fa93458381c83d4579fa047761 /scripts/xface2xbm.in
parent* proto.h (readHeader): added (diff)
downloadw3m-739eb5f7ab4d8d10e054ba80813bc1d9e3307450.tar.gz
w3m-739eb5f7ab4d8d10e054ba80813bc1d9e3307450.zip
[w3m-dev 03129] Re: X-Face
* configure (use_xface): ask * fm.h (_Buffer): add header_source * buffer.c (reshapeBuffer): fix reshape when reading stdin with image fix disappearing header when reading stdin * file.c (xface2xbm): check file existence * file.c (readHeader): save to tmp file X-Face when activeImage & displayImage * main.c (dispI): comment out checking content type * main.c (stopI): ditto * scripts/xface2xbm.in: update compface URL read from file $XF write to file $XBM From: Hironori Sakamoto <hsaka@mth.biglobe.ne.jp>
Diffstat (limited to 'scripts/xface2xbm.in')
-rw-r--r--scripts/xface2xbm.in23
1 files changed, 16 insertions, 7 deletions
diff --git a/scripts/xface2xbm.in b/scripts/xface2xbm.in
index 2c2002a..7d6bede 100644
--- a/scripts/xface2xbm.in
+++ b/scripts/xface2xbm.in
@@ -1,13 +1,19 @@
#!@PERL@
-# See http://www.lab3.kuis.kyoto-u.ac.jp/~tsumura/emacs/x-face.html
+# compface/uncompface
+# ftp://metalab.unc.edu/pub/Linux/apps/graphics/convert/
$UNCOMPFACE = "uncompface";
+$XF = @ARGV ? shift @ARGV : '-';
+$XBM = @ARGV ? shift @ARGV : '-';
+
+open(XF, "<$XF");
$xf = "";
-while(<>) {
+while(<XF>) {
# s/^X-Face://i if ($xf eq "");
$xf .= $_;
}
+close(XF);
pipe(R, W2);
pipe(R2, W);
@@ -17,7 +23,7 @@ if (! fork()) {
open(STDIN, "<&R2");
open(STDOUT, ">&W2");
exec $UNCOMPFACE;
- die;
+ exit 1;
}
close(R2);
close(W2);
@@ -29,10 +35,12 @@ while(<R>) {
}
}
close(R);
+@bm || exit 1;
$W = 48;
$H = @bm * 8 / $W; # must be 48
-print <<EOF;
+open(XBM, ">$XBM");
+print XBM <<EOF;
#define xf_width $W
#define xf_height $H
static char xf_bits[] = {
@@ -45,10 +53,11 @@ while (@bm) {
$y |= ($x & 1) << (8 - $i);
$x >>= 1;
}
- printf " 0x%02X,", $y;
+ printf XBM " 0x%02X,", $y;
}
- print "\n";
+ print XBM "\n";
}
-print <<EOF;
+print XBM <<EOF;
};
EOF
+close(XBM);