diff options
author | Chris Severance | 2015-07-17 03:02:33 -0400 |
---|---|---|
committer | Chris Severance | 2015-07-17 03:02:33 -0400 |
commit | cb4d41da19b8204d4fbe4721d5f97b65e09aaa8c (patch) | |
tree | e890d441b70a7a87ae920dd26fc4c2622c5b7490 /FONTVER.pl | |
parent | 179cccfa7a5e6fcd51ea1992df90bcb718b42ac6 (diff) | |
download | aur-cb4d41da19b8204d4fbe4721d5f97b65e09aaa8c.tar.gz |
Custom handling for case and sums
Diffstat (limited to 'FONTVER.pl')
-rwxr-xr-x | FONTVER.pl | 29 |
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); |