CompFace

SiteMap | RecentChanges | ElispArea | HowTo

X-Faces are header lines encoding a bitmap picture. The X-Face header is added to your outgoing mail and news, and Gnus will render the X-Face for all incoming mail and news.

Making an X-Face

Here's how to produce such a header for yourself. You will need compface, ImageMagick and the netpbm tools.

  1. Find a picture of your own face you like
  2. Resize it to 48x48 (use the "Scale Image" and "Crop" options of gimp, as needed)
  3. Save as png or any other format
  4. Convert it to a portable bitmap (pbm) without dithering (48x48 is too small for dithering to look good); example: convert +dither alex48.png alex48.pbm
  5. Conversion from a (color) picture to the b/w pbm won't necc. be great.. at this point, you may want to run gimp on the pbm and clear up the extraneous dots..
  6. Convert the portable bitmap to an icon file; example: pbmtoicon alex48.pbm > alex48.icon
  7. Edit the icon file such that there are exactly three values per line, 48 lines in total, and no comment at the start of the file (see below for an example) --- a quick way to achieve this is to: remove comments, then C-u 99999 C-x f, M-q, M-% , by , SPC and then C-u C-x f 33, and then M-q.
  8. Run compface on the file
  9. Edit the compface output: replace \ with \\ and " with \". Also, adding or removing newlines to compface output is okay, I think.
  10. Add the X-Face header to your outgoing mails and postings (see below for an example using PostingStyles)

Example compface input

Here's how to do it, based on the icon file:

  1. Remove comments (C-k C-k C-k C-k)
  2. Replace all commas with a space (M-% , RET SPC RET !)
  3. Set the fill column to 21 (C-u 21 C-x f)
  4. Fill the file (M-q)
  5. Replace all spaces with commas (M-% SPC RET , RET !)
  6. Add a comma to all lines (M-% C-q C-j RET , C-q C-j RET !)
  7. Make sure there really are 48 lines of values (add "0xffff,0xffff,0xffff" or something like that to fill it up)
  8. Remove the last comma
  9. Save as compface input file

    0x0000,0x00c8,0x00e0,
    0x0000,0x01c8,0x00e0,
    0x0000,0x0ffe,0x00c0,
    ...
    0x0dff,0x1fff,0xffff,
    0x1fef,0x0fff,0xffff,
    0xffff,0xffff,0xffff

Set X-Face header

 (setq gnus-posting-styles
       '(...
         ("emacs"
          ...
	  ("X-Face" <nowiki>"^BC$`[IcggstLPyen&dqF+b2'zyK#r.mU*'Nms}@&4zw%SJ#5!/7SMVjBS7'lb;QK)|IPU5U'o1'522W4TyzB3Ab*IBo^iw]l4|kUbdZuUDO6=Um-.4IzhNiV'B\"@K#jy_(wW|Zbk[34flKY^|PrQ?$u2\\fKg^]AY>wOX#H32i")</nowiki>
          ...)
         ...))
   ..)

Showing faces

Gnus should set the variable `gnus-treat-display-xface' to the symbol `head' if it detects the command `uncompface' in your path.

Not showing faces

You can set the variable `gnus-treat-display-xface' to nil to prevent X-Faces from showing up.

If the variable `gnus-article-x-face-too-ugly' (which is a regexp) matches the `From' header, the face will not be shown.


CategoryGnus
SiteMap | RecentChanges | ElispArea | HowTo
Edit text of this page | View other revisions
Last edited 2002-10-26 22:28 UTC (diff)
Search:
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation.