OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 "SkEndian.h" | 9 #include "SkEndian.h" |
10 #include "SkFontStream.h" | 10 #include "SkFontStream.h" |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 static const char* const gNames[] = { | 216 static const char* const gNames[] = { |
217 nullptr, // default font | 217 nullptr, // default font |
218 "Helvetica", "Arial", | 218 "Helvetica", "Arial", |
219 "Times", "Times New Roman", | 219 "Times", "Times New Roman", |
220 "Courier", "Courier New", | 220 "Courier", "Courier New", |
221 "Terminal", "MS Sans Serif", | 221 "Terminal", "MS Sans Serif", |
222 "Hiragino Mincho ProN", "MS PGothic", | 222 "Hiragino Mincho ProN", "MS PGothic", |
223 }; | 223 }; |
224 | 224 |
225 for (size_t i = 0; i < SK_ARRAY_COUNT(gNames); ++i) { | 225 for (size_t i = 0; i < SK_ARRAY_COUNT(gNames); ++i) { |
226 sk_sp<SkTypeface> face(SkTypeface::MakeFromName(gNames[i], SkTypeface::k
Normal)); | 226 sk_sp<SkTypeface> face(SkTypeface::MakeFromName(gNames[i], SkFontStyle()
)); |
227 if (face) { | 227 if (face) { |
228 #ifdef DUMP_TABLES | 228 #ifdef DUMP_TABLES |
229 SkDebugf("%s\n", gNames[i]); | 229 SkDebugf("%s\n", gNames[i]); |
230 #endif | 230 #endif |
231 test_tables(reporter, face); | 231 test_tables(reporter, face); |
232 test_unitsPerEm(reporter, face); | 232 test_unitsPerEm(reporter, face); |
233 test_countGlyphs(reporter, face); | 233 test_countGlyphs(reporter, face); |
234 test_charsToGlyphs(reporter, face); | 234 test_charsToGlyphs(reporter, face); |
235 } | 235 } |
236 } | 236 } |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 { SK_Scalar1/2, 0 }, | 270 { SK_Scalar1/2, 0 }, |
271 // these two exercise obliquing (skew) | 271 // these two exercise obliquing (skew) |
272 { SK_Scalar1, -SK_Scalar1/4 }, | 272 { SK_Scalar1, -SK_Scalar1/4 }, |
273 { SK_Scalar1/2, -SK_Scalar1/4 }, | 273 { SK_Scalar1/2, -SK_Scalar1/4 }, |
274 }; | 274 }; |
275 | 275 |
276 SkPaint paint; | 276 SkPaint paint; |
277 char txt[] = "long.text.with.lots.of.dots."; | 277 char txt[] = "long.text.with.lots.of.dots."; |
278 | 278 |
279 for (size_t i = 0; i < SK_ARRAY_COUNT(faces); i++) { | 279 for (size_t i = 0; i < SK_ARRAY_COUNT(faces); i++) { |
280 paint.setTypeface(SkTypeface::MakeFromName(faces[i], SkTypeface::kNormal
)); | 280 paint.setTypeface(SkTypeface::MakeFromName(faces[i], SkFontStyle())); |
281 | 281 |
282 for (size_t j = 0; j < SK_ARRAY_COUNT(settings); j++) { | 282 for (size_t j = 0; j < SK_ARRAY_COUNT(settings); j++) { |
283 paint.setHinting(settings[j].hinting); | 283 paint.setHinting(settings[j].hinting); |
284 paint.setLinearText((settings[j].flags & SkPaint::kLinearText_Flag)
!= 0); | 284 paint.setLinearText((settings[j].flags & SkPaint::kLinearText_Flag)
!= 0); |
285 paint.setSubpixelText((settings[j].flags & SkPaint::kSubpixelText_Fl
ag) != 0); | 285 paint.setSubpixelText((settings[j].flags & SkPaint::kSubpixelText_Fl
ag) != 0); |
286 | 286 |
287 for (size_t k = 0; k < SK_ARRAY_COUNT(gScaleRec); ++k) { | 287 for (size_t k = 0; k < SK_ARRAY_COUNT(gScaleRec); ++k) { |
288 paint.setTextScaleX(gScaleRec[k].fScaleX); | 288 paint.setTextScaleX(gScaleRec[k].fScaleX); |
289 paint.setTextSkewX(gScaleRec[k].fSkewX); | 289 paint.setTextSkewX(gScaleRec[k].fSkewX); |
290 | 290 |
(...skipping 16 matching lines...) Expand all Loading... |
307 } | 307 } |
308 | 308 |
309 DEF_TEST(FontHost, reporter) { | 309 DEF_TEST(FontHost, reporter) { |
310 test_tables(reporter); | 310 test_tables(reporter); |
311 test_fontstream(reporter); | 311 test_fontstream(reporter); |
312 test_advances(reporter); | 312 test_advances(reporter); |
313 test_symbolfont(reporter); | 313 test_symbolfont(reporter); |
314 } | 314 } |
315 | 315 |
316 // need tests for SkStrSearch | 316 // need tests for SkStrSearch |
OLD | NEW |