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 SkFontStream_DEFINED | 8 #ifndef SkFontStream_DEFINED |
9 #define SkFontStream_DEFINED | 9 #define SkFontStream_DEFINED |
10 | 10 |
11 class SkStream; | 11 class SkStream; |
12 | 12 |
13 #include "SkTypeface.h" | 13 #include "SkTypeface.h" |
14 | 14 |
15 class SkFontStream { | 15 class SkFontStream { |
16 public: | 16 public: |
17 /** | 17 /** |
| 18 * Return the number of shared 'fonts' inside a TTC sfnt, or return 0 |
| 19 * if the stream is a normal sfnt (not a TTC). |
| 20 * |
18 * Note: the stream is rewound initially, but is returned at an arbitrary | 21 * Note: the stream is rewound initially, but is returned at an arbitrary |
19 * read offset. | 22 * read offset. |
20 */ | 23 */ |
21 static int GetTableTags(SkStream*, SkFontTableTag tags[]); | 24 static int CountTTCEntries(SkStream*); |
22 | 25 |
23 /** | 26 /** |
| 27 * @param ttcIndex 0 for normal sfnts, or the index within a TTC sfnt. |
| 28 * |
24 * Note: the stream is rewound initially, but is returned at an arbitrary | 29 * Note: the stream is rewound initially, but is returned at an arbitrary |
25 * read offset. | 30 * read offset. |
26 */ | 31 */ |
27 static size_t GetTableData(SkStream*, SkFontTableTag tag, | 32 static int GetTableTags(SkStream*, int ttcIndex, SkFontTableTag tags[]); |
| 33 |
| 34 /** |
| 35 * @param ttcIndex 0 for normal sfnts, or the index within a TTC sfnt. |
| 36 * |
| 37 * Note: the stream is rewound initially, but is returned at an arbitrary |
| 38 * read offset. |
| 39 */ |
| 40 static size_t GetTableData(SkStream*, int ttcIndex, SkFontTableTag tag, |
28 size_t offset, size_t length, void* data); | 41 size_t offset, size_t length, void* data); |
29 }; | 42 }; |
30 | 43 |
31 #endif | 44 #endif |
OLD | NEW |