font: drop droid in favour of roboto and noto
[sheet.git] / tools / convert-allfonts
index f3ccffc45d6f112d7254c295c297bcb57264cb96..9d75e0642ef00c89ff585aca2e010e0d96c45e33 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";
@@ -47,7 +56,7 @@ if (my $dvpath = '/usr/share/fonts/truetype/ttf-dejavu') {
 
 if (my $gdpath = '/usr/share/fonts/truetype/droid') {
        if (my $src = first { -e } map { glob "$_/DroidSans.ttf" } $gdpath, @ttfpath) {
-               system $convbin, $src, "$outdir/droidsans.inc.pl";
+               system $convbin, $src, "$outdir/droid.inc.pl";
        }
        if (my $src = first { -e } map { glob "$_/DroidSerif.ttf" } $gdpath, @ttfpath) {
                system $convbin, $src, "$outdir/droidserif.inc.pl";
@@ -57,6 +66,21 @@ if (my $gdpath = '/usr/share/fonts/truetype/droid') {
        }
 }
 
+if (my $grpath = '/usr/share/fonts/truetype/roboto') {
+       if (my $src = first { -e } map { glob "$_/Roboto-Regular.ttf" } $grpath, @ttfpath) {
+               system $convbin, $src, "$outdir/roboto.inc.pl";
+       }
+}
+
+if (my $gnpath = '/usr/share/fonts/truetype/noto') {
+       if (my $src = first { -e } map { glob "$_/NotoSans-Regular.ttf" } $gnpath, @ttfpath) {
+               system $convbin, $src, "$outdir/noto.inc.pl";
+       }
+       if (my $src = first { -e } map { glob "$_/NotoSerif-Regular.ttf" } $gnpath, @ttfpath) {
+               system $convbin, $src, "$outdir/noto.inc.pl";
+       }
+}
+
 {
        if (my $src = first { -e } map { glob "$_/code2000.ttf" } @ttfpath) {
                system $convbin, $src, "$outdir/c2k.inc.pl";