font: include version in font name hover
[sheet.git] / tools / mkfontinfo
index e212d94a8aba715362a91c3957b2c2a971229f53..85fa91441c51d3cb468e6b37b37456fecc8d12f2 100755 (executable)
@@ -18,6 +18,12 @@ for my $fontfile (glob 'ttfsupport/*'.$incsuffix) {
        my ($fontid) = basename($fontfile, $incsuffix);
        my ($fontmeta, @fontrange) = do $fontfile or next;
        $fontmeta->{file} = $fontid;
+       my $year = substr $fontmeta->{date}, 0, 4;
+       $fontmeta->{description} = join(' ',
+               (map { "version $_" } $fontmeta->{version} || ()),
+               $fontmeta->{version} && $fontmeta->{version} =~ /\Q$year/ ? () :
+               (map { "($_)" } $year || ()),
+       );
        push @fontlist, $fontmeta;
        $cover{$fontid} = { map { (chr $_ => 1) } @fontrange };
 }