| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 #ifndef SkFontConfigInterface_DEFINED | 8 #ifndef SkFontConfigInterface_DEFINED |
| 9 #define SkFontConfigInterface_DEFINED | 9 #define SkFontConfigInterface_DEFINED |
| 10 | 10 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 * Given a familyName and style, find the best match. | 73 * Given a familyName and style, find the best match. |
| 74 * | 74 * |
| 75 * If a match is found, return true and set its outFontIdentifier. | 75 * If a match is found, return true and set its outFontIdentifier. |
| 76 * If outFamilyName is not null, assign the found familyName to it | 76 * If outFamilyName is not null, assign the found familyName to it |
| 77 * (which may differ from the requested familyName). | 77 * (which may differ from the requested familyName). |
| 78 * If outStyle is not null, assign the found style to it | 78 * If outStyle is not null, assign the found style to it |
| 79 * (which may differ from the requested style). | 79 * (which may differ from the requested style). |
| 80 * | 80 * |
| 81 * If a match is not found, return false, and ignore all out parameters. | 81 * If a match is not found, return false, and ignore all out parameters. |
| 82 */ | 82 */ |
| 83 #ifdef SK_VERY_LEGACY_CREATE_TYPEFACE |
| 83 virtual bool matchFamilyName(const char familyName[], | 84 virtual bool matchFamilyName(const char familyName[], |
| 84 SkTypeface::Style requested, | 85 SkTypeface::Style requested, |
| 85 FontIdentity* outFontIdentifier, | 86 FontIdentity* outFontIdentifier, |
| 86 SkString* outFamilyName, | 87 SkString* outFamilyName, |
| 87 SkTypeface::Style* outStyle) = 0; | 88 SkTypeface::Style* outStyle) = 0; |
| 89 #else |
| 90 virtual bool matchFamilyName(const char familyName[], |
| 91 SkFontStyle requested, |
| 92 FontIdentity* outFontIdentifier, |
| 93 SkString* outFamilyName, |
| 94 SkFontStyle* outStyle) = 0; |
| 95 #endif |
| 88 | 96 |
| 89 /** | 97 /** |
| 90 * Given a FontRef, open a stream to access its data, or return null | 98 * Given a FontRef, open a stream to access its data, or return null |
| 91 * if the FontRef's data is not available. The caller is responsible for | 99 * if the FontRef's data is not available. The caller is responsible for |
| 92 * deleting the stream when it is done accessing the data. | 100 * deleting the stream when it is done accessing the data. |
| 93 */ | 101 */ |
| 94 virtual SkStreamAsset* openStream(const FontIdentity&) = 0; | 102 virtual SkStreamAsset* openStream(const FontIdentity&) = 0; |
| 95 | 103 |
| 96 /** | 104 /** |
| 97 * Return an SkTypeface for the given FontIdentity. | 105 * Return an SkTypeface for the given FontIdentity. |
| (...skipping 14 matching lines...) Expand all Loading... |
| 112 */ | 120 */ |
| 113 static SkFontConfigInterface* GetSingletonDirectInterface(SkBaseMutex* mutex
= NULL); | 121 static SkFontConfigInterface* GetSingletonDirectInterface(SkBaseMutex* mutex
= NULL); |
| 114 | 122 |
| 115 // New APIS, which have default impls for now (which do nothing) | 123 // New APIS, which have default impls for now (which do nothing) |
| 116 | 124 |
| 117 virtual SkDataTable* getFamilyNames() { return SkDataTable::NewEmpty(); } | 125 virtual SkDataTable* getFamilyNames() { return SkDataTable::NewEmpty(); } |
| 118 typedef SkRefCnt INHERITED; | 126 typedef SkRefCnt INHERITED; |
| 119 }; | 127 }; |
| 120 | 128 |
| 121 #endif | 129 #endif |
| OLD | NEW |