OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 The Android Open Source Project | 2 * Copyright 2011 The Android Open Source Project |
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 "SkAdvancedTypefaceMetrics.h" | 8 #include "SkAdvancedTypefaceMetrics.h" |
9 #include "SkFontDescriptor.h" | 9 #include "SkFontDescriptor.h" |
10 #include "SkFontHost.h" | 10 #include "SkFontHost.h" |
11 #include "SkFontStream.h" | |
12 #include "SkStream.h" | 11 #include "SkStream.h" |
13 #include "SkTypeface.h" | 12 #include "SkTypeface.h" |
14 | 13 |
15 SK_DEFINE_INST_COUNT(SkTypeface) | 14 SK_DEFINE_INST_COUNT(SkTypeface) |
16 | 15 |
17 //#define TRACE_LIFECYCLE | 16 //#define TRACE_LIFECYCLE |
18 | 17 |
19 #ifdef TRACE_LIFECYCLE | 18 #ifdef TRACE_LIFECYCLE |
20 static int32_t gTypefaceCounter; | 19 static int32_t gTypefaceCounter; |
21 #endif | 20 #endif |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 /////////////////////////////////////////////////////////////////////////////// | 216 /////////////////////////////////////////////////////////////////////////////// |
218 | 217 |
219 int SkTypeface::onCharsToGlyphs(const void* chars, Encoding encoding, | 218 int SkTypeface::onCharsToGlyphs(const void* chars, Encoding encoding, |
220 uint16_t glyphs[], int glyphCount) const { | 219 uint16_t glyphs[], int glyphCount) const { |
221 SkDebugf("onCharsToGlyphs unimplemented\n"); | 220 SkDebugf("onCharsToGlyphs unimplemented\n"); |
222 if (glyphs && glyphCount > 0) { | 221 if (glyphs && glyphCount > 0) { |
223 sk_bzero(glyphs, glyphCount * sizeof(glyphs[0])); | 222 sk_bzero(glyphs, glyphCount * sizeof(glyphs[0])); |
224 } | 223 } |
225 return 0; | 224 return 0; |
226 } | 225 } |
227 | |
228 int SkTypeface::onGetTableTags(SkFontTableTag tags[]) const { | |
229 int ttcIndex; | |
230 SkAutoTUnref<SkStream> stream(this->openStream(&ttcIndex)); | |
231 return stream.get() ? SkFontStream::GetTableTags(stream, ttcIndex, tags) : 0
; | |
232 } | |
233 | |
234 size_t SkTypeface::onGetTableData(SkFontTableTag tag, size_t offset, | |
235 size_t length, void* data) const { | |
236 int ttcIndex; | |
237 SkAutoTUnref<SkStream> stream(this->openStream(&ttcIndex)); | |
238 return stream.get() | |
239 ? SkFontStream::GetTableData(stream, ttcIndex, tag, offset, length, data
) | |
240 : 0; | |
241 } | |
OLD | NEW |