#!/bin/sh # # Test drive an OpenType font # CMD=totf quit() { cd .. rm -rf $tmpdir exit $1 } [ $# -eq 0 ] && { echo "usage: totf [otftotfm_options] font" >&2; exit 1; } np=$#; eval otf=\$$np [ -f "$otf" ] || { echo "$CMD: Missing file '$otf'" >&2; exit 1; } case "$otf" in /*) ;; *) otf=../$otf;; esac tmpdir=$(mktemp -d .totf.XXXXXX) || exit 1 i=1 for p in "$@"; do [ $i -eq 1 ] && set -- [ $i -eq $np ] && break [ "$last_p" = "-e" ] && case "$p" in /*) ;; *) p=../$p;; esac set -- "$@" "$p" last_p=$p i=$(($i + 1)) done set -- "$@" "$otf" cd $tmpdir mkfont "$@" || quit 1 sed 's/^\/.*\[$/\/TextEncoding \[/' *.enc >encoding.enc tpsfp -c -e encoding.enc *.pfb || quit 1 quit 0 .