OLD | NEW |
| (Empty) |
1 /* | |
2 * Copyright 2011 Google Inc. | |
3 * | |
4 * Use of this source code is governed by a BSD-style license that can be | |
5 * found in the LICENSE file. | |
6 */ | |
7 | |
8 #include "SkEndian.h" | |
9 #include "SkFontHost.h" | |
10 #include "SkFontStream.h" | |
11 #include "SkStream.h" | |
12 | |
13 int SkFontHost::CountTables(SkFontID fontID) { | |
14 SkStream* stream = SkFontHost::OpenStream(fontID); | |
15 if (NULL == stream) { | |
16 return 0; | |
17 } | |
18 | |
19 SkAutoUnref au(stream); | |
20 int ttcIndex = 0; | |
21 return SkFontStream::GetTableTags(stream, ttcIndex, NULL); | |
22 } | |
23 | |
24 int SkFontHost::GetTableTags(SkFontID fontID, SkFontTableTag tags[]) { | |
25 SkStream* stream = SkFontHost::OpenStream(fontID); | |
26 if (NULL == stream) { | |
27 return 0; | |
28 } | |
29 | |
30 SkAutoUnref au(stream); | |
31 int ttcIndex = 0; | |
32 return SkFontStream::GetTableTags(stream, ttcIndex, tags); | |
33 } | |
34 | |
35 size_t SkFontHost::GetTableSize(SkFontID fontID, SkFontTableTag tag) { | |
36 SkStream* stream = SkFontHost::OpenStream(fontID); | |
37 if (NULL == stream) { | |
38 return 0; | |
39 } | |
40 | |
41 SkAutoUnref au(stream); | |
42 int ttcIndex = 0; | |
43 return SkFontStream::GetTableData(stream, ttcIndex, tag, 0, ~0U, NULL); | |
44 } | |
45 | |
46 size_t SkFontHost::GetTableData(SkFontID fontID, SkFontTableTag tag, | |
47 size_t offset, size_t length, void* data) { | |
48 SkStream* stream = SkFontHost::OpenStream(fontID); | |
49 if (NULL == stream) { | |
50 return 0; | |
51 } | |
52 | |
53 SkAutoUnref au(stream); | |
54 int ttcIndex = 0; | |
55 return SkFontStream::GetTableData(stream, ttcIndex, tag, offset, length, dat
a); | |
56 } | |
OLD | NEW |