| 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 "SkFontConfigParser_android.h" | 8 #include "SkFontConfigParser_android.h" |
| 9 #include "SkFontDescriptor.h" | 9 #include "SkFontDescriptor.h" |
| 10 #include "SkFontHost_FreeType_common.h" | 10 #include "SkFontHost_FreeType_common.h" |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 , fPathName(pathName) | 74 , fPathName(pathName) |
| 75 , fLang(lang) | 75 , fLang(lang) |
| 76 , fVariantStyle(variantStyle) { } | 76 , fVariantStyle(variantStyle) { } |
| 77 | 77 |
| 78 virtual void onGetFontDescriptor(SkFontDescriptor* desc, | 78 virtual void onGetFontDescriptor(SkFontDescriptor* desc, |
| 79 bool* serialize) const SK_OVERRIDE { | 79 bool* serialize) const SK_OVERRIDE { |
| 80 SkASSERT(desc); | 80 SkASSERT(desc); |
| 81 SkASSERT(serialize); | 81 SkASSERT(serialize); |
| 82 desc->setFamilyName(fFamilyName.c_str()); | 82 desc->setFamilyName(fFamilyName.c_str()); |
| 83 desc->setFontFileName(fPathName.c_str()); | 83 desc->setFontFileName(fPathName.c_str()); |
| 84 desc->setFontIndex(fIndex); |
| 84 *serialize = false; | 85 *serialize = false; |
| 85 } | 86 } |
| 86 virtual SkStream* onOpenStream(int* ttcIndex) const SK_OVERRIDE { | 87 virtual SkStream* onOpenStream(int* ttcIndex) const SK_OVERRIDE { |
| 87 *ttcIndex = fIndex; | 88 *ttcIndex = fIndex; |
| 88 return SkStream::NewFromFile(fPathName.c_str()); | 89 return SkStream::NewFromFile(fPathName.c_str()); |
| 89 } | 90 } |
| 90 | 91 |
| 91 const SkString fPathName; | 92 const SkString fPathName; |
| 92 const SkLanguage fLang; | 93 const SkLanguage fLang; |
| 93 const FontVariant fVariantStyle; | 94 const FontVariant fVariantStyle; |
| (...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 529 SkDEBUGF(("Use Test Config File Main %s, Fallback %s, Font Dir %s", | 530 SkDEBUGF(("Use Test Config File Main %s, Fallback %s, Font Dir %s", |
| 530 gTestMainConfigFile, gTestFallbackConfigFile, gTestFontFilePrefix)
); | 531 gTestMainConfigFile, gTestFallbackConfigFile, gTestFontFilePrefix)
); |
| 531 } | 532 } |
| 532 | 533 |
| 533 void SkGetTestFontConfiguration(const char** mainconf, const char** fallbackconf
, | 534 void SkGetTestFontConfiguration(const char** mainconf, const char** fallbackconf
, |
| 534 const char** fontsdir) { | 535 const char** fontsdir) { |
| 535 *mainconf = gTestMainConfigFile; | 536 *mainconf = gTestMainConfigFile; |
| 536 *fallbackconf = gTestFallbackConfigFile; | 537 *fallbackconf = gTestFallbackConfigFile; |
| 537 *fontsdir = gTestFontFilePrefix; | 538 *fontsdir = gTestFontFilePrefix; |
| 538 } | 539 } |
| OLD | NEW |