OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "Resources.h" | 8 #include "Resources.h" |
9 #include "SkCommandLineFlags.h" | 9 #include "SkCommandLineFlags.h" |
10 #include "SkFontConfigParser_android.h" | 10 #include "SkFontConfigParser_android.h" |
(...skipping 30 matching lines...) Expand all Loading... | |
41 REPORTER_ASSERT(reporter, !fontFamilies[0]->fIsFallbackFont); | 41 REPORTER_ASSERT(reporter, !fontFamilies[0]->fIsFallbackFont); |
42 | 42 |
43 // Check that the languages are all sane. | 43 // Check that the languages are all sane. |
44 for (int i = 0; i < fontFamilies.count(); ++i) { | 44 for (int i = 0; i < fontFamilies.count(); ++i) { |
45 const SkString& lang = fontFamilies[i]->fLanguage.getTag(); | 45 const SkString& lang = fontFamilies[i]->fLanguage.getTag(); |
46 for (size_t j = 0; j < lang.size(); ++j) { | 46 for (size_t j = 0; j < lang.size(); ++j) { |
47 int c = lang[j]; | 47 int c = lang[j]; |
48 REPORTER_ASSERT(reporter, isALPHA(c) || isDIGIT(c) || '-' == c); | 48 REPORTER_ASSERT(reporter, isALPHA(c) || isDIGIT(c) || '-' == c); |
49 } | 49 } |
50 } | 50 } |
51 | |
52 // All file names in the test configuration files start with a capital lette r. | |
djsollen
2015/02/13 16:17:49
comment that this isn't a requirement, but since i
bungeman-skia
2015/02/13 16:38:07
Done.
| |
53 for (int i = 0; i < fontFamilies.count(); ++i) { | |
54 FontFamily& family = *fontFamilies[i]; | |
55 for (int j = 0; j < family.fFonts.count(); ++j) { | |
56 FontFileInfo& file = family.fFonts[j]; | |
57 REPORTER_ASSERT(reporter, !file.fFileName.isEmpty() && | |
58 file.fFileName[0] >= 'A' && | |
59 file.fFileName[0] <= 'Z'); | |
60 } | |
61 } | |
51 } | 62 } |
52 | 63 |
53 void DumpLoadedFonts(SkTDArray<FontFamily*> fontFamilies) { | 64 void DumpLoadedFonts(SkTDArray<FontFamily*> fontFamilies) { |
54 if (!FLAGS_verboseFontMgr) { | 65 if (!FLAGS_verboseFontMgr) { |
55 return; | 66 return; |
56 } | 67 } |
57 | 68 |
58 for (int i = 0; i < fontFamilies.count(); ++i) { | 69 for (int i = 0; i < fontFamilies.count(); ++i) { |
59 SkDebugf("Family %d:\n", i); | 70 SkDebugf("Family %d:\n", i); |
60 switch(fontFamilies[i]->fVariant) { | 71 switch(fontFamilies[i]->fVariant) { |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
130 ValidateLoadedFonts(v22FontFamilies, "Roboto-Thin.ttf", reporter); | 141 ValidateLoadedFonts(v22FontFamilies, "Roboto-Thin.ttf", reporter); |
131 } else { | 142 } else { |
132 resourcesMissing = true; | 143 resourcesMissing = true; |
133 } | 144 } |
134 | 145 |
135 if (resourcesMissing) { | 146 if (resourcesMissing) { |
136 SkDebugf("---- Resource files missing for FontConfigParser test\n"); | 147 SkDebugf("---- Resource files missing for FontConfigParser test\n"); |
137 } | 148 } |
138 } | 149 } |
139 | 150 |
OLD | NEW |