summarylogtreecommitdiffstats
path: root/FONTVER.pl
diff options
context:
space:
mode:
authorChris Severance2015-07-17 03:02:33 -0400
committerChris Severance2015-07-17 03:02:33 -0400
commitcb4d41da19b8204d4fbe4721d5f97b65e09aaa8c (patch)
treee890d441b70a7a87ae920dd26fc4c2622c5b7490 /FONTVER.pl
parent179cccfa7a5e6fcd51ea1992df90bcb718b42ac6 (diff)
downloadaur-cb4d41da19b8204d4fbe4721d5f97b65e09aaa8c.tar.gz
Custom handling for case and sums
Diffstat (limited to 'FONTVER.pl')
-rwxr-xr-xFONTVER.pl29
1 files changed, 29 insertions, 0 deletions
diff --git a/FONTVER.pl b/FONTVER.pl
new file mode 100755
index 000000000000..bec9b4b760f1
--- /dev/null
+++ b/FONTVER.pl
@@ -0,0 +1,29 @@
+#!/usr/bin/perl
+
+# Extract: Version 0.00 Font Name Bold
+use warnings;
+#http://www.perlmonks.org/bare/?node_id=224506
+use strict;
+use Font::TTF::Font;
+#use CGI qw(:all);
+
+#print header();
+my $rv=1;
+if ( $#ARGV >= 0 ) {
+ my $f = $ARGV[0];
+ my $fontname = Font::TTF::Font->open($f);
+ if (ref $fontname) {
+ my $fnar;
+ if ($fnar = $fontname->{name}) {
+ my $fr=$fnar->read;
+# http://www.microsoft.com/typography/otspec/name.htm Name IDs
+ print $fr->find_name(5)." ".$fr->find_name(4);
+ $rv=0;
+ }
+ $fontname->release();
+ }
+} else {
+ print "Usage: $0 foo.ttf\n";
+ print "Result: Version 1.05 Foo Narrow Bold Italic\n";
+}
+exit($rv);