From b118dd18d3e0b3829e6814af684e30d683b7e67d Mon Sep 17 00:00:00 2001 From: Fumitoshi UKAI Date: Wed, 13 Mar 2002 17:04:56 +0000 Subject: [w3m-dev 03127] X-Face * NEWS: X-Face support * configure (use_xface): added * config.h.dist (USE_XFACE): added (XFACE2XBM): added * file.c (xface2xbm): added (readHeader): X-Face: handling * scripts/Makefile (LIB_TARGETS): add xface2xbm * scripts/xface2xbm.in: added From: Hironori Sakamoto --- scripts/Makefile | 2 +- scripts/xface2xbm.in | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 scripts/xface2xbm.in (limited to 'scripts') diff --git a/scripts/Makefile b/scripts/Makefile index 239378f..af1cd79 100644 --- a/scripts/Makefile +++ b/scripts/Makefile @@ -6,7 +6,7 @@ LIB_DIR = $(prefix)/lib/w3m HELP_DIR = $(prefix)/lib/w3m RC_DIR = ~/.w3m -LIB_TARGETS = dirlist.cgi w3mhelp.cgi w3mmail.cgi +LIB_TARGETS = dirlist.cgi w3mhelp.cgi w3mmail.cgi xface2xbm HELP_LIBS = w3mhelp-funcname.pl w3mhelp-funcdesc.pl MKDIR = mkdir -p diff --git a/scripts/xface2xbm.in b/scripts/xface2xbm.in new file mode 100644 index 0000000..2c2002a --- /dev/null +++ b/scripts/xface2xbm.in @@ -0,0 +1,54 @@ +#!@PERL@ + +# See http://www.lab3.kuis.kyoto-u.ac.jp/~tsumura/emacs/x-face.html +$UNCOMPFACE = "uncompface"; + +$xf = ""; +while(<>) { +# s/^X-Face://i if ($xf eq ""); + $xf .= $_; +} + +pipe(R, W2); +pipe(R2, W); +if (! fork()) { + close(R); + close(W); + open(STDIN, "<&R2"); + open(STDOUT, ">&W2"); + exec $UNCOMPFACE; + die; +} +close(R2); +close(W2); +print W $xf; +close(W); +while() { + while(s/0x(..)(..)//) { + push(@bm, hex($1), hex($2)); + } +} +close(R); + +$W = 48; +$H = @bm * 8 / $W; # must be 48 +print <>= 1; + } + printf " 0x%02X,", $y; + } + print "\n"; +} +print <