-TTFDIR_MS=/usr/share/fonts/truetype/msttcorefonts
-if [ -e $TTFDIR_MS ]; then
-$CONVBIN $TTFDIR_MS/Verdana.ttf $OUTDIR/verdana.inc.pl
-$CONVBIN $TTFDIR_MS/Times_New_Roman.ttf $OUTDIR/times.inc.pl
-$CONVBIN $TTFDIR_MS/Arial.ttf $OUTDIR/arial.inc.pl
-$CONVBIN $TTFDIR_MS/Courier_New.ttf $OUTDIR/courier.inc.pl
-$CONVBIN $TTFDIR_MS/Comic_Sans_MS.ttf $OUTDIR/comic.inc.pl
-$CONVBIN $TTFDIR_MS/Georgia.ttf $OUTDIR/georgia.inc.pl
-fi
+if (my $mspath = '/usr/share/fonts/truetype/msttcorefonts') {
+ if (my $src = first { -e } map { glob "$_/Verdana.ttf" } $mspath, @ttfpath) {
+ system $convbin, $src, "$outdir/verdana.inc.pl";
+ }
+ if (my $src = first { -e } map { glob "$_/Times_New_Roman.ttf" } $mspath, @ttfpath) {
+ system $convbin, $src, "$outdir/times.inc.pl";
+ }
+ if (my $src = first { -e } map { glob "$_/Arial.ttf" } $mspath, @ttfpath) {
+ system $convbin, $src, "$outdir/arial.inc.pl";
+ }
+ if (my $src = first { -e } map { glob "$_/Courier_New.ttf" } $mspath, @ttfpath) {
+ system $convbin, $src, "$outdir/courier.inc.pl";
+ }
+ if (my $src = first { -e } map { glob "$_/Comic_Sans_MS.ttf" } $mspath, @ttfpath) {
+ system $convbin, $src, "$outdir/comic.inc.pl";
+ }
+ if (my $src = first { -e } map { glob "$_/Georgia.ttf" } $mspath, @ttfpath) {
+ system $convbin, $src, "$outdir/georgia.inc.pl";
+ }
+}