| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2009 Google Inc. | 2 * Copyright 2009 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 /* migrated from chrome/src/skia/ext/SkFontHost_fontconfig_direct.cpp */ | 8 /* migrated from chrome/src/skia/ext/SkFontHost_fontconfig_direct.cpp */ |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 }; | 33 }; |
| 34 | 34 |
| 35 SkFontConfigInterface* SkFontConfigInterface::GetSingletonDirectInterface() { | 35 SkFontConfigInterface* SkFontConfigInterface::GetSingletonDirectInterface() { |
| 36 static SkFontConfigInterface* gDirect; | 36 static SkFontConfigInterface* gDirect; |
| 37 if (NULL == gDirect) { | 37 if (NULL == gDirect) { |
| 38 gDirect = new SkFontConfigInterfaceDirect; | 38 gDirect = new SkFontConfigInterfaceDirect; |
| 39 } | 39 } |
| 40 return gDirect; | 40 return gDirect; |
| 41 } | 41 } |
| 42 | 42 |
| 43 int SkFontConfigInterface::countFamilies() { return 0; } |
| 44 |
| 45 int SkFontConfigInterface::getFamilySet(int index, SkString* outFamilyName, |
| 46 FontIdentity outIdentities[], |
| 47 int maxCount) { |
| 48 return 0; |
| 49 } |
| 50 |
| 51 int SkFontConfigInterface::matchFamilySet(const char familyName[], |
| 52 SkString* outFamilyName, |
| 53 FontIdentity outIdentities[], |
| 54 int maxCount) { |
| 55 return 0; |
| 56 } |
| 57 |
| 58 /////////////////////////////////////////////////////////////////////////////// |
| 59 |
| 43 namespace { | 60 namespace { |
| 44 | 61 |
| 45 // Equivalence classes, used to match the Liberation and other fonts | 62 // Equivalence classes, used to match the Liberation and other fonts |
| 46 // with their metric-compatible replacements. See the discussion in | 63 // with their metric-compatible replacements. See the discussion in |
| 47 // GetFontEquivClass(). | 64 // GetFontEquivClass(). |
| 48 enum FontEquivClass | 65 enum FontEquivClass |
| 49 { | 66 { |
| 50 OTHER, | 67 OTHER, |
| 51 SANS, | 68 SANS, |
| 52 SERIF, | 69 SERIF, |
| (...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 422 } | 439 } |
| 423 if (outStyle) { | 440 if (outStyle) { |
| 424 *outStyle = GetFontStyle(match); | 441 *outStyle = GetFontStyle(match); |
| 425 } | 442 } |
| 426 return true; | 443 return true; |
| 427 } | 444 } |
| 428 | 445 |
| 429 SkStream* SkFontConfigInterfaceDirect::openStream(const FontIdentity& identity)
{ | 446 SkStream* SkFontConfigInterfaceDirect::openStream(const FontIdentity& identity)
{ |
| 430 return SkStream::NewFromFile(identity.fString.c_str()); | 447 return SkStream::NewFromFile(identity.fString.c_str()); |
| 431 } | 448 } |
| OLD | NEW |