#!/bin/sh # # txt2gif file # # Convert a plain text file into a GIF image for display on the IM Example # pages. The GIF image filename is exactly the same as the given input # filename but with a ".gif" suffix appended. # ### # Anthony Thyssen # IM Example settings common to all examples [ -f ./generate_options ] && . ./generate_options [ -f ../generate_options ] && . ../generate_options [ -f ../../generate_options ] && . ../../generate_options # TXT2GIF conversion expand "$1" | #fmt -s | # Expand Tabs (freetype can't handle) perl -0777 -pe 's/\n$//' | # remove last newline from txt input #sed 's/\\/\\\\/g' | # Escape escapes -- removed IM v6.3.3 convert -font CourierNew -pointsize 12 \ -background "$txt_bg_color" label:@- \ -bordercolor "$txt_bg_color" -border 1 \ "$1.gif"