OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2008 Google Inc. | 2 * Copyright 2008 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 "SkFontConfigInterface.h" | 8 #include "SkFontConfigInterface.h" |
9 #include "SkFontDescriptor.h" | 9 #include "SkFontDescriptor.h" |
10 #include "SkFontHost.h" | 10 #include "SkFontHost.h" |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 } | 169 } |
170 | 170 |
171 SkTypeface* SkFontHost::CreateTypefaceFromFile(const char path[]) { | 171 SkTypeface* SkFontHost::CreateTypefaceFromFile(const char path[]) { |
172 SkAutoTUnref<SkStream> stream(SkStream::NewFromFile(path)); | 172 SkAutoTUnref<SkStream> stream(SkStream::NewFromFile(path)); |
173 return stream.get() ? CreateTypefaceFromStream(stream) : NULL; | 173 return stream.get() ? CreateTypefaceFromStream(stream) : NULL; |
174 } | 174 } |
175 | 175 |
176 /////////////////////////////////////////////////////////////////////////////// | 176 /////////////////////////////////////////////////////////////////////////////// |
177 | 177 |
178 // DEPRECATED | 178 // DEPRECATED |
179 int SkFontHost::CountTables(SkFontID fontID) { | |
180 SkTypeface* face = SkTypefaceCache::FindByID(fontID); | |
181 return face ? face->onGetTableTags(NULL) : 0; | |
182 } | |
183 | |
184 // DEPRECATED | |
185 int SkFontHost::GetTableTags(SkFontID fontID, SkFontTableTag tags[]) { | |
186 SkTypeface* face = SkTypefaceCache::FindByID(fontID); | |
187 return face ? face->onGetTableTags(tags) : 0; | |
188 } | |
189 | |
190 // DEPRECATED | |
191 size_t SkFontHost::GetTableSize(SkFontID fontID, SkFontTableTag tag) { | |
192 SkTypeface* face = SkTypefaceCache::FindByID(fontID); | |
193 return face ? face->onGetTableData(tag, 0, ~0U, NULL) : 0; | |
194 } | |
195 | |
196 // DEPRECATED | |
197 size_t SkFontHost::GetTableData(SkFontID fontID, SkFontTableTag tag, | |
198 size_t offset, size_t length, void* dst) { | |
199 SkTypeface* face = SkTypefaceCache::FindByID(fontID); | |
200 return face ? face->onGetTableData(tag, offset, length, dst) : 0; | |
201 } | |
202 | |
203 // DEPRECATED | |
204 SkTypeface* SkFontHost::NextLogicalTypeface(SkFontID curr, SkFontID orig) { | 179 SkTypeface* SkFontHost::NextLogicalTypeface(SkFontID curr, SkFontID orig) { |
205 // We don't handle font fallback. | 180 // We don't handle font fallback. |
206 return NULL; | 181 return NULL; |
207 } | 182 } |
208 | 183 |
209 /////////////////////////////////////////////////////////////////////////////// | 184 /////////////////////////////////////////////////////////////////////////////// |
210 | 185 |
211 // Serialize, Deserialize need to be compatible across platforms, hence the use | 186 // Serialize, Deserialize need to be compatible across platforms, hence the use |
212 // of SkFontDescriptor. | 187 // of SkFontDescriptor. |
213 | 188 |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 return stream.get() | 272 return stream.get() |
298 ? SkFontStream::GetTableData(stream, ttcIndex, | 273 ? SkFontStream::GetTableData(stream, ttcIndex, |
299 tag, offset, length, data) | 274 tag, offset, length, data) |
300 : 0; | 275 : 0; |
301 } | 276 } |
302 | 277 |
303 void FontConfigTypeface::onGetFontDescriptor(SkFontDescriptor* desc) const { | 278 void FontConfigTypeface::onGetFontDescriptor(SkFontDescriptor* desc) const { |
304 desc->setStyle(this->style()); | 279 desc->setStyle(this->style()); |
305 desc->setFamilyName(this->getFamilyName()); | 280 desc->setFamilyName(this->getFamilyName()); |
306 } | 281 } |
| 282 |
OLD | NEW |