local: ppmbutton(1)



ppmbutton - create a pixmap with text


ppmbutton { --truetype | --x11 | -f } fontname [ { --light | -l } light_color ] [ [ { --dark | -d } dark_color ] [ [ { --shadowcolor | -s } shadow_color ] [ { --shadowx | -x } xoffset ] [ { --shadowy | -y } yoffset ] [ { --border | -b } pixels ] [ { --em | -M } pixels ] [ { --text | -t } text_color ] [ { --output | -o } filename ] string


Produces a portable pixmap resembling a button labeled string in text_color. The left and upper edge have color light_color, the right and lower edge are drawn in dark_color. The interior of the button changes gradually from light_color in the upper left corner to dark_color in the lower right corner.

If one of the shadow options is given, the text is duplicated xoffset pixels to the right and yoffset pixels below the original text in shadowcolor. The shadow is a little softened by applying a 3x3 averaging filter twice.

The font can either be retrieved from a Truetype font file or from an X server (given by the DISPLAY environment variable). If the -f option is given (instead of the explicit --truetype or --x11 option), the argument is assumed to be the name of a truetype font file if it ends in .fnt, else a standard X11 font name is assumed. For truetype fonts the size of the font should be given with the --em option. Unfortunately the unitsPerEM parameter of a truetype font seems to be only very vaguely related to the width of the capital M, so you will have to experiment with this value. For X11 fonts the size is given as part of the font name.

The colors are specified in hexadecimal format #rrggbb.


This program is still too specialized. It should be able to create buttons in many styles.
There are no useful defaults, so command lines tend to be rather long. I am thinking of reading arguments from stdin for the next release.
The truetype support is very primitive. Kerning is not yet supported, and I suspect the rendering code to be simply wrong for low resolutions (I just copied it) - Use high resolutions (about 100 pixels per em) and scale down the result with ppmscale. It also supports only the Unicode character set and format 4 character tables.
Support for X11 color names has been discontinued in this version. It may come back some day.


The truetype rendering code is taken almost completely from the spline program of an anonymous author. I filled in missing pieces from povray 3.0 (an excellent raytracing package, BTW).


ppm(5), ppmmake(1)


Peter J. Holzer
local2.0 - 6 October 1996