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" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 protected: | 42 protected: |
43 virtual SkStream* onOpenStream(int* ttcIndex) const SK_OVERRIDE { return NUL
L; } | 43 virtual SkStream* onOpenStream(int* ttcIndex) const SK_OVERRIDE { return NUL
L; } |
44 virtual SkScalerContext* onCreateScalerContext(const SkDescriptor*) const SK
_OVERRIDE { | 44 virtual SkScalerContext* onCreateScalerContext(const SkDescriptor*) const SK
_OVERRIDE { |
45 return NULL; | 45 return NULL; |
46 } | 46 } |
47 virtual void onFilterRec(SkScalerContextRec*) const SK_OVERRIDE { } | 47 virtual void onFilterRec(SkScalerContextRec*) const SK_OVERRIDE { } |
48 virtual SkAdvancedTypefaceMetrics* onGetAdvancedTypefaceMetrics( | 48 virtual SkAdvancedTypefaceMetrics* onGetAdvancedTypefaceMetrics( |
49 SkAdvancedTypefaceMetrics::PerGlyphInfo, | 49 SkAdvancedTypefaceMetrics::PerGlyphInfo, |
50 const uint32_t*, uint32_t) const SK_OVERRIDE { r
eturn NULL; } | 50 const uint32_t*, uint32_t) const SK_OVERRIDE { r
eturn NULL; } |
51 virtual void onGetFontDescriptor(SkFontDescriptor*, bool*) const SK_OVERRIDE
{ } | 51 virtual void onGetFontDescriptor(SkFontDescriptor*, bool*) const SK_OVERRIDE
{ } |
| 52 virtual int onCharsToGlyphs(const void* chars, Encoding encoding, |
| 53 uint16_t glyphs[], int glyphCount) const SK_OVER
RIDE { |
| 54 if (glyphs && glyphCount > 0) { |
| 55 sk_bzero(glyphs, glyphCount * sizeof(glyphs[0])); |
| 56 } |
| 57 return 0; |
| 58 } |
52 virtual int onCountGlyphs() const SK_OVERRIDE { return 0; }; | 59 virtual int onCountGlyphs() const SK_OVERRIDE { return 0; }; |
53 virtual int onGetUPEM() const SK_OVERRIDE { return 0; }; | 60 virtual int onGetUPEM() const SK_OVERRIDE { return 0; }; |
54 class EmptyLocalizedStrings : public SkTypeface::LocalizedStrings { | 61 class EmptyLocalizedStrings : public SkTypeface::LocalizedStrings { |
55 public: | 62 public: |
56 virtual bool next(SkTypeface::LocalizedString*) SK_OVERRIDE { return fal
se; } | 63 virtual bool next(SkTypeface::LocalizedString*) SK_OVERRIDE { return fal
se; } |
57 }; | 64 }; |
58 virtual SkTypeface::LocalizedStrings* onCreateFamilyNameIterator() const SK_
OVERRIDE { | 65 virtual SkTypeface::LocalizedStrings* onCreateFamilyNameIterator() const SK_
OVERRIDE { |
59 return SkNEW(EmptyLocalizedStrings); | 66 return SkNEW(EmptyLocalizedStrings); |
60 }; | 67 }; |
61 virtual int onGetTableTags(SkFontTableTag tags[]) const SK_OVERRIDE { return
0; } | 68 virtual int onGetTableTags(SkFontTableTag tags[]) const SK_OVERRIDE { return
0; } |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 SkAdvancedTypefaceMetrics* SkTypeface::getAdvancedTypefaceMetrics( | 247 SkAdvancedTypefaceMetrics* SkTypeface::getAdvancedTypefaceMetrics( |
241 SkAdvancedTypefaceMetrics::PerGlyphInfo info, | 248 SkAdvancedTypefaceMetrics::PerGlyphInfo info, |
242 const uint32_t* glyphIDs, | 249 const uint32_t* glyphIDs, |
243 uint32_t glyphIDsCount) const { | 250 uint32_t glyphIDsCount) const { |
244 return this->onGetAdvancedTypefaceMetrics(info, glyphIDs, glyphIDsCount); | 251 return this->onGetAdvancedTypefaceMetrics(info, glyphIDs, glyphIDsCount); |
245 } | 252 } |
246 | 253 |
247 SkTypeface* SkTypeface::refMatchingStyle(Style style) const { | 254 SkTypeface* SkTypeface::refMatchingStyle(Style style) const { |
248 return this->onRefMatchingStyle(style); | 255 return this->onRefMatchingStyle(style); |
249 } | 256 } |
250 | |
251 /////////////////////////////////////////////////////////////////////////////// | |
252 /////////////////////////////////////////////////////////////////////////////// | |
253 | |
254 int SkTypeface::onCharsToGlyphs(const void* chars, Encoding encoding, | |
255 uint16_t glyphs[], int glyphCount) const { | |
256 static bool printed = false; | |
257 if (!printed) { | |
258 // Only want to see this message once | |
259 SkDebugf("\n *** onCharsToGlyphs unimplemented ***\n"); | |
260 printed = true; | |
261 } | |
262 if (glyphs && glyphCount > 0) { | |
263 sk_bzero(glyphs, glyphCount * sizeof(glyphs[0])); | |
264 } | |
265 return 0; | |
266 } | |
OLD | NEW |