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

Unified Diff: scripts/newbitmaps/strings/text_to_bmp

Issue 6825032: Add the latest localized text strings, update scripts to support them. (Closed) Base URL: ssh://gitrw.chromium.org:9222/vboot_reference.git@master
Patch Set: Created 9 years, 8 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/newbitmaps/strings/localized_text/zh-TW/yuck.txt ('k') | scripts/newbitmaps/strings/url.TXT » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scripts/newbitmaps/strings/text_to_bmp
diff --git a/scripts/newbitmaps/strings/text_to_bmp b/scripts/newbitmaps/strings/text_to_bmp
index e0c77b99810c9e221bd99fae16411f1ba4e8cc7a..7d145d8656981c9029ab0ad2e58b789ef9915934 100755
--- a/scripts/newbitmaps/strings/text_to_bmp
+++ b/scripts/newbitmaps/strings/text_to_bmp
@@ -3,7 +3,8 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
-# Render a text file into a bitmap.
+# Render a text file into a bitmap. Files named '*.txt' are small font, those
+# nameed '*.TXT' are large font.
#
# Image parameters
@@ -21,7 +22,11 @@ label_file="${tmpdir}/label.txt"
for txtfile in $*; do
bmpfile="${txtfile%.*}".bmp
+ # Must strip off the leading U+FEFF byte order mark (bytes 0xEF,0xBB,0xBF) of
+ # each file before I can pass it to imagemagick. Chomp any leading/trailing
+ # whitespace too.
perl -p -e 'BEGIN{ $/=undef; }' \
+ -e 'if (substr($_,0,3) eq "\xef\xbb\xbf") { substr($_, 0, 3) = ""; }' \
-e 's/^\s+//s;' -e 's/\s+$//s;' \
"$txtfile" > "$label_file"
« no previous file with comments | « scripts/newbitmaps/strings/localized_text/zh-TW/yuck.txt ('k') | scripts/newbitmaps/strings/url.TXT » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698