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 "SkAdvancedTypefaceMetrics.h" |
8 #include "SkBitmap.h" | 9 #include "SkBitmap.h" |
9 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
10 #include "SkDescriptor.h" | 11 #include "SkDescriptor.h" |
11 #include "SkFontDescriptor.h" | 12 #include "SkFontDescriptor.h" |
12 #include "SkGlyph.h" | 13 #include "SkGlyph.h" |
13 #include "SkMask.h" | 14 #include "SkMask.h" |
14 // #include "SkOTUtils.h" | 15 // #include "SkOTUtils.h" |
15 #include "SkScalerContext.h" | 16 #include "SkScalerContext.h" |
16 #include "SkTestScalerContext.h" | 17 #include "SkTestScalerContext.h" |
17 #include "SkTypefaceCache.h" | 18 #include "SkTypefaceCache.h" |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 void SkTestTypeface::getPath(const SkGlyph& glyph, SkPath* path) { | 134 void SkTestTypeface::getPath(const SkGlyph& glyph, SkPath* path) { |
134 *path = *fTestFont->fPaths[glyph.getGlyphID()]; | 135 *path = *fTestFont->fPaths[glyph.getGlyphID()]; |
135 } | 136 } |
136 | 137 |
137 void SkTestTypeface::onFilterRec(SkScalerContextRec* rec) const { | 138 void SkTestTypeface::onFilterRec(SkScalerContextRec* rec) const { |
138 rec->setHinting(SkPaint::kNo_Hinting); | 139 rec->setHinting(SkPaint::kNo_Hinting); |
139 rec->fMaskFormat = SkMask::kA8_Format; | 140 rec->fMaskFormat = SkMask::kA8_Format; |
140 } | 141 } |
141 | 142 |
142 SkAdvancedTypefaceMetrics* SkTestTypeface::onGetAdvancedTypefaceMetrics( | 143 SkAdvancedTypefaceMetrics* SkTestTypeface::onGetAdvancedTypefaceMetrics( |
143 SkAdvancedTypefaceMetrics::PerGlyphInfo , | 144 PerGlyphInfo , |
144 const uint32_t* glyphIDs, | 145 const uint32_t* glyphIDs, |
145 uint32_t glyphIDsCount) const { | 146 uint32_t glyphIDsCount) const { |
146 // pdf only | 147 // pdf only |
147 SkAdvancedTypefaceMetrics* info = new SkAdvancedTypefaceMetrics; | 148 SkAdvancedTypefaceMetrics* info = new SkAdvancedTypefaceMetrics; |
148 info->fEmSize = 0; | 149 info->fEmSize = 0; |
149 info->fLastGlyphID = SkToU16(onCountGlyphs() - 1); | 150 info->fLastGlyphID = SkToU16(onCountGlyphs() - 1); |
150 info->fStyle = 0; | 151 info->fStyle = 0; |
151 info->fFontName.set(fTestFont->fName); | 152 info->fFontName.set(fTestFont->fName); |
152 info->fType = SkAdvancedTypefaceMetrics::kOther_Font; | 153 info->fType = SkAdvancedTypefaceMetrics::kOther_Font; |
153 info->fItalicAngle = 0; | 154 info->fItalicAngle = 0; |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 } | 286 } |
286 | 287 |
287 private: | 288 private: |
288 SkTestTypeface* fFace; | 289 SkTestTypeface* fFace; |
289 SkMatrix fMatrix; | 290 SkMatrix fMatrix; |
290 }; | 291 }; |
291 | 292 |
292 SkScalerContext* SkTestTypeface::onCreateScalerContext(const SkDescriptor* desc)
const { | 293 SkScalerContext* SkTestTypeface::onCreateScalerContext(const SkDescriptor* desc)
const { |
293 return SkNEW_ARGS(SkTestScalerContext, (const_cast<SkTestTypeface*>(this), d
esc)); | 294 return SkNEW_ARGS(SkTestScalerContext, (const_cast<SkTestTypeface*>(this), d
esc)); |
294 } | 295 } |
OLD | NEW |