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