OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 "SkBitmap.h" | 8 #include "SkBitmap.h" |
9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 #include "SkDescriptor.h" | 10 #include "SkDescriptor.h" |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 info->fAscent = 0; | 154 info->fAscent = 0; |
155 info->fDescent = 0; | 155 info->fDescent = 0; |
156 info->fStemV = 0; | 156 info->fStemV = 0; |
157 info->fCapHeight = 0; | 157 info->fCapHeight = 0; |
158 info->fBBox = SkIRect::MakeEmpty(); | 158 info->fBBox = SkIRect::MakeEmpty(); |
159 return info; | 159 return info; |
160 } | 160 } |
161 | 161 |
162 void SkTestTypeface::onGetFontDescriptor(SkFontDescriptor* desc, bool* isLocal)
const { | 162 void SkTestTypeface::onGetFontDescriptor(SkFontDescriptor* desc, bool* isLocal)
const { |
163 desc->setFamilyName(fTestFont->fName); | 163 desc->setFamilyName(fTestFont->fName); |
164 desc->setFontFileName(fTestFont->fName); | |
165 *isLocal = false; | 164 *isLocal = false; |
166 } | 165 } |
167 | 166 |
168 int SkTestTypeface::onCharsToGlyphs(const void* chars, Encoding encoding, | 167 int SkTestTypeface::onCharsToGlyphs(const void* chars, Encoding encoding, |
169 uint16_t glyphs[], int glyphCount) const { | 168 uint16_t glyphs[], int glyphCount) const { |
170 SkASSERT(encoding == kUTF16_Encoding); | 169 SkASSERT(encoding == kUTF16_Encoding); |
171 for (int index = 0; index < glyphCount; ++index) { | 170 for (int index = 0; index < glyphCount; ++index) { |
172 SkUnichar ch = ((SkUnichar*) chars)[index]; | 171 SkUnichar ch = ((SkUnichar*) chars)[index]; |
173 glyphs[index] = fTestFont->codeToIndex(ch); | 172 glyphs[index] = fTestFont->codeToIndex(ch); |
174 } | 173 } |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 } | 285 } |
287 | 286 |
288 private: | 287 private: |
289 SkTestTypeface* fFace; | 288 SkTestTypeface* fFace; |
290 SkMatrix fMatrix; | 289 SkMatrix fMatrix; |
291 }; | 290 }; |
292 | 291 |
293 SkScalerContext* SkTestTypeface::onCreateScalerContext(const SkDescriptor* desc)
const { | 292 SkScalerContext* SkTestTypeface::onCreateScalerContext(const SkDescriptor* desc)
const { |
294 return SkNEW_ARGS(SkTestScalerContext, (const_cast<SkTestTypeface*>(this), d
esc)); | 293 return SkNEW_ARGS(SkTestScalerContext, (const_cast<SkTestTypeface*>(this), d
esc)); |
295 } | 294 } |
OLD | NEW |