font: generate data for apple fonts from OS X
[sheet.git] / tools / convert-allfonts
index f3ccffc45d6f112d7254c295c297bcb57264cb96..5f0c6aa8cd84de36089c58a52f6ccae540a88af4 100755 (executable)
@@ -8,9 +8,9 @@ use File::Basename 'dirname';
 
 chdir dirname $0;
 
-my $convbin = './convert-ttf.pl';
+my $convbin = './mkttfinfo';
 my $outdir = '../ttfsupport';
-my @ttfpath = '~/.fonts';  # local fallbacks
+my @ttfpath = ('~/.fonts', '../data/osx-fonts');  # local fallbacks
 
 if (my $mspath = '/usr/share/fonts/truetype/msttcorefonts') {
        if (my $src = first { -e } map { glob "$_/Verdana.ttf" } $mspath, @ttfpath) {
@@ -33,6 +33,15 @@ if (my $mspath = '/usr/share/fonts/truetype/msttcorefonts') {
        }
 }
 
+if (my $ampath = '/usr/share/fonts/truetype/macfonts') {
+       if (my $src = first { -e } map { glob "$_/Lucida?Grande.ttf" } $ampath, @ttfpath) {
+               system $convbin, $src, "$outdir/lucida.inc.pl";
+       }
+       if (my $src = first { -e } map { glob "$_/AppleGaramond.ttf" } $ampath, @ttfpath) {
+               system $convbin, $src, "$outdir/garamond.inc.pl";
+       }
+}
+
 if (my $dvpath = '/usr/share/fonts/truetype/ttf-dejavu') {
        if (my $src = first { -e } map { glob "$_/DejaVuSans.ttf" } $dvpath, @ttfpath) {
                system $convbin, $src, "$outdir/dvsans.inc.pl";