Changeset 18115 in josm for trunk/scripts


Ignore:
Timestamp:
2021-08-02T17:44:33+02:00 (4 years ago)
Author:
stoecker
Message:

add font-checks to geticons.pl, see #21143

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/scripts/geticons.pl

    r16876 r18115  
    1212  "src/org/openstreetmap/josm/*/*/*/*.java",
    1313  "src/org/openstreetmap/josm/*/*/*/*/*.java",
    14   "src/org/openstreetmap/josm/*/*/*/*/*/*.java"
     14  "src/org/openstreetmap/josm/*/*/*/*/*/*.java",
     15  "src/org/openstreetmap/josm/*/*/*/*/*/*/*.java"
    1516);
    1617
     
    4142      if($l =~ /icon\s*[:=]\s*["']([^"'+]+?)["']/)
    4243      {
    43         ++$icons{$1};
     44        my $i = $1;
     45        ++$icons{$i};
    4446      }
    4547
    4648      if(($l =~ /(?:icon-image|repeat-image|fill-image)\s*:\s*(\"?(.*?)\"?)\s*;/) && ($1 ne "none"))
    4749      {
    48         my $img = $2;
    49         ++$icons{$img};
     50        my $i = $2;
     51        ++$icons{$i};
    5052      }
    5153      if($l =~ /ImageProvider(?:\.get)?\(\"([^\"]*?)\"(?:, (?:ImageProvider\.)?ImageSizes\.[A-Z]+)?\)/)
     
    149151      if(open FILE, "<","resources/images/$ifile")
    150152      {
     153        my $hadfont = 0;
    151154        undef $/;
    152155        my $f = <FILE>;
     
    159162            {
    160163              print STDERR "$ifile: Style starts with minus: $x\n" if $x =~ /^-/;
     164              ++$hadfont if($x =~ /^font-/);
     165              if($x =~ /^font-family:(.*)$/ && $x !~ /^font-family:'Droid Sans'/)
     166              {
     167                print STDERR "$ifile: Unwanted font-family: $1\n"
     168              }
    161169            }
    162170          }
     
    170178          my $x = $1;
    171179          print STDERR "$ifile: ViewBox has float values: $x\n" if $x =~ /\./;
     180        }
     181        if($f !~ /<text/ && $hadfont)
     182        {
     183          print STDERR "$ifile: Font-style without <text>\n";
    172184        }
    173185      }
Note: See TracChangeset for help on using the changeset viewer.