my ($ttfuri, $outfile) = @ARGV;
$ttfuri or die "usage error\n";
+my $fontinc = $ENV{FONTINC} // '~/.fonts,/usr/share/fonts/truetype/*';
+if (!-e $ttfuri) {
+ my $found = (grep {-e} glob "{$fontinc}/$ttfuri")[0] or do {
+ warn "font not found: $ttfuri\n";
+ exit 1;
+ };
+ $ttfuri = $found;
+}
+
for ($outfile || ()) {
open my $output, '>', $_ or die "Cannot write to $outfile: $!\n";
select $output;