font: clean up version and revision numbers
authorMischa POSLAWSKY <perl@shiar.org>
Thu, 5 Mar 2015 04:11:03 +0000 (05:11 +0100)
committerMischa POSLAWSKY <perl@shiar.org>
Tue, 9 Jun 2015 03:43:43 +0000 (05:43 +0200)
Some fonts prefix 'Version' to number, some don't.
Revision number is stored as single-precision float (f), so needs to be
rounded to avoid showing erroneous digits.

tools/mkttfinfo

index 370ff97289204ecb7a8cc28f7324913d05f0781c..916e7f3643bc0854945e61b6effe0abb0af47fc4 100755 (executable)
@@ -39,8 +39,8 @@ for ($outfile || ()) {
        my %meta = (
                source   => $ttfuri =~ m{(^/usr/.+ | [^/]+) \z}msx,
                name     => $ttfmeta->find_name(4) || $ttfname,
-               revision => $ttf->{head}->{fontRevision},
-               version  => scalar $ttfmeta->find_name(5),
+               revision => sprintf('%g', $ttf->{head}->{fontRevision}),
+               version  => $ttfmeta->find_name(5) =~ s/\Aversion //ri,
                copyright=> scalar $ttfmeta->find_name(0),
                license  => $ttfmeta->find_name(14) || undef,
                date     => (map {