Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(893)

Unified Diff: scripts/bitmaps/makelines

Issue 4158003: Change bitmap scripts for two-color/two-font text labeling. (Closed) Base URL: http://git.chromium.org/git/vboot_reference.git
Patch Set: Created 10 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « scripts/bitmaps/make_bmp_images.sh ('k') | scripts/bitmaps/originals/DeveloperBmp.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scripts/bitmaps/makelines
diff --git a/scripts/bitmaps/makelines b/scripts/bitmaps/makelines
new file mode 100755
index 0000000000000000000000000000000000000000..68e42f4d20de18fa214e5fd08c3de0ee3befe64d
--- /dev/null
+++ b/scripts/bitmaps/makelines
@@ -0,0 +1,41 @@
+#!/usr/bin/perl
+
+use strict;
+our $opt_u = 'http://www.chromium.org';
+our $opt_m = 'Unsupported Prototype 0000';
+our $opt_d = '.';
+
+use File::Basename;
+my $progdir = dirname($0);
+my $prog = basename($0);
+
+use Getopt::Std;
+my $usage = "
+Usage: $prog
+
+";
+getopts('u:m:d:') or die $usage;
+
+my @old = glob("$opt_d/linetxt_*");
+unlink(@old) if @old;
+
+$/ = undef;
+$_ = <>;
+s/\s+$//gs;
+
+my $count = 1;
+foreach (split(/\n/, $_))
+{
+ s/^\s+//;
+ s/\s+$//;
+ s/\$URL/$opt_u/g;
+ s/\$MODEL/$opt_m/g;
+ $_ = ' ' unless $_;
+ my $big = s/^\$BIG:\s*//;
+ my $filename = sprintf('%s/linetxt_%02d.%s', $opt_d, $count++,
+ $big ? 'TXT' : 'txt');
+# print "$filename: ($_)\n"; next;
+ open(OUT, ">$filename") || die "$0 can't write $filename: $!\n";
+ print OUT "$_";
+ close(OUT);
+}
« no previous file with comments | « scripts/bitmaps/make_bmp_images.sh ('k') | scripts/bitmaps/originals/DeveloperBmp.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698