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

Side by Side Diff: third_party/ots/test/test_unmalicious_fonts.sh

Issue 775893002: Updating OTS repo from https://github.com/khaledhosny/ots.git (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updating with 4800 warning fix Created 6 years 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 unified diff | Download patch
« no previous file with comments | « third_party/ots/test/test_malicious_fonts.sh ('k') | third_party/ots/test/validator-checker.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #!/bin/bash
2
3 # Copyright (c) 2009 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file.
6
7 # Usage: ./test_unmalicious_fonts.sh [ttf_or_otf_file_name]
8
9 BLACKLIST=./BLACKLIST.txt
10 CHECKER=./idempotent
11
12 if [ ! -r "$BLACKLIST" ] ; then
13 echo "$BLACKLIST is not found."
14 exit 1
15 fi
16
17 if [ ! -x "$CHECKER" ] ; then
18 echo "$CHECKER is not found."
19 exit 1
20 fi
21
22 if [ $# -eq 0 ] ; then
23 # No font file is specified. Apply this script to all TT/OT files under the
24 # BASE_DIR below.
25
26 # On Ubuntu Linux (>= 8.04), You can install ~1800 TrueType/OpenType fonts
27 # to /usr/share/fonts/truetype by:
28 # % sudo apt-get install ttf-.*[^0]$
29 BASE_DIR=/usr/share/fonts/truetype/
30 if [ ! -d $BASE_DIR ] ; then
31 # Mac OS X
32 BASE_DIR="/Library/Fonts/ /System/Library/Fonts/"
33 fi
34 # TODO(yusukes): Support Cygwin.
35
36 # Recursively call this script.
37 find $BASE_DIR -type f -name '*tf' -exec "$0" {} \;
38 echo
39 exit 0
40 fi
41
42 if [ $# -gt 1 ] ; then
43 echo "Usage: $0 [ttf_or_otf_file_name]"
44 exit 1
45 fi
46
47 # Check the font file using idempotent iff the font is not blacklisted.
48 base=`basename "$1"`
49 egrep -i -e "^$base" "$BLACKLIST" > /dev/null 2>&1 || "$CHECKER" "$1" > /dev/nul l 2>&1 || (echo ; echo "FAIL: $1 (Run $CHECKER $1 for more information.)")
50 echo -n "."
OLDNEW
« no previous file with comments | « third_party/ots/test/test_malicious_fonts.sh ('k') | third_party/ots/test/validator-checker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698