-open FILE, $sz_fname or die $!;
-
-while (my $line = <FILE>) {
- chomp($line);
- next unless $line;
- my ($width, $height, $fname) = split(/ /, $line, 3);
- $sizes{$fname} = [$width, $height];
-
- # Find a potential short form (acronym for multiword, no extension otherwise)
- my $acro = '';
-
- # remove article for the purpose of the shortening; we don't care if it's
- # in the middle of a word because we only care about initials anyway
- # FIXME this actually fails in the case of XXXthe-XXX, let's care about that
- # when we actually come across it
- my $the = $fname;
- $the =~ s/the-//g;
- if ($the =~ /-/) {
- $acro = join('', map { uc(substr($_, 0, 1)) } split(/-/, $the ));
- } else {
- $acro = (split(/\./, $the))[0]
- }
- if (!defined $acros{$acro}) {
- $acros{$acro} = $fname;
- } else {
- print STDERR "Trying to redefined acronym $acro from $acros{$acro} to ${fname}\n";
+sub load_sizes() {
+ open FILE, $sz_fname or die $!;
+
+ while (my $line = <FILE>) {
+ chomp($line);
+ next unless $line;
+ my ($width, $height, $fname) = split(/ /, $line, 3);
+ $sizes{$fname} = [$width, $height];
+
+ # Find a potential short form (acronym for multiword, no extension otherwise)
+ my $acro = '';
+
+ # remove article for the purpose of the shortening; we don't care if it's
+ # in the middle of a word because we only care about initials anyway
+ # FIXME this actually fails in the case of XXXthe-XXX, let's care about that
+ # when we actually come across it
+ my $the = $fname;
+ $the =~ s/the-//g;
+ if ($the =~ /-/) {
+ $acro = join('', map { uc(substr($_, 0, 1)) } split(/-/, $the ));
+ } else {
+ $acro = (split(/\./, $the))[0]
+ }
+ if (!defined $acros{$acro}) {
+ $acros{$acro} = $fname;
+ $revacros{$fname} = $acro;
+ } else {
+ print STDERR "Trying to redefined acronym $acro from $acros{$acro} to ${fname}\n";
+ }