Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(299)

Side by Side Diff: src/core/SkTypeface.cpp

Issue 29363009: prototype for kerning api (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « include/core/SkTypeface.h ('k') | src/ports/SkFontHost_FreeType.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 226
227 int SkTypeface::countGlyphs() const { 227 int SkTypeface::countGlyphs() const {
228 return this->onCountGlyphs(); 228 return this->onCountGlyphs();
229 } 229 }
230 230
231 int SkTypeface::getUnitsPerEm() const { 231 int SkTypeface::getUnitsPerEm() const {
232 // should we try to cache this in the base-class? 232 // should we try to cache this in the base-class?
233 return this->onGetUPEM(); 233 return this->onGetUPEM();
234 } 234 }
235 235
236 bool SkTypeface::getKerningPairAdjustments(const uint16_t glyphs[], int count,
237 int32_t adjustments[]) const {
238 SkASSERT(count >= 0);
239 // chedk for the only legal way to pass a NULL.. everthing is 0
bungeman-skia 2013/10/30 15:05:57 s/chedk/check s/everthing/everything
240 // in which case they just want to know if this face can possibly support
241 // kerning (true) or never (false).
242 if (NULL == glyphs || NULL == adjustments) {
243 SkASSERT(NULL == glyphs);
244 SkASSERT(0 == count);
245 SkASSERT(NULL == adjustments);
246 }
247 return this->onGetKerningPairAdjustments(glyphs, count, adjustments);
248 }
249
236 SkTypeface::LocalizedStrings* SkTypeface::createFamilyNameIterator() const { 250 SkTypeface::LocalizedStrings* SkTypeface::createFamilyNameIterator() const {
237 return this->onCreateFamilyNameIterator(); 251 return this->onCreateFamilyNameIterator();
238 } 252 }
239 253
240 void SkTypeface::getFamilyName(SkString* name) const { 254 void SkTypeface::getFamilyName(SkString* name) const {
241 bool isLocal = false; 255 bool isLocal = false;
242 SkFontDescriptor desc(this->style()); 256 SkFontDescriptor desc(this->style());
243 this->onGetFontDescriptor(&desc, &isLocal); 257 this->onGetFontDescriptor(&desc, &isLocal);
244 name->set(desc.getFamilyName()); 258 name->set(desc.getFamilyName());
245 } 259 }
246 260
247 SkAdvancedTypefaceMetrics* SkTypeface::getAdvancedTypefaceMetrics( 261 SkAdvancedTypefaceMetrics* SkTypeface::getAdvancedTypefaceMetrics(
248 SkAdvancedTypefaceMetrics::PerGlyphInfo info, 262 SkAdvancedTypefaceMetrics::PerGlyphInfo info,
249 const uint32_t* glyphIDs, 263 const uint32_t* glyphIDs,
250 uint32_t glyphIDsCount) const { 264 uint32_t glyphIDsCount) const {
251 return this->onGetAdvancedTypefaceMetrics(info, glyphIDs, glyphIDsCount); 265 return this->onGetAdvancedTypefaceMetrics(info, glyphIDs, glyphIDsCount);
252 } 266 }
253 267
254 SkTypeface* SkTypeface::refMatchingStyle(Style style) const { 268 SkTypeface* SkTypeface::refMatchingStyle(Style style) const {
255 return this->onRefMatchingStyle(style); 269 return this->onRefMatchingStyle(style);
256 } 270 }
271
272 ///////////////////////////////////////////////////////////////////////////////
273
274 bool SkTypeface::onGetKerningPairAdjustments(const uint16_t glyphs[], int count,
275 int32_t adjustments[]) const {
276 return false;
277 }
278
OLDNEW
« no previous file with comments | « include/core/SkTypeface.h ('k') | src/ports/SkFontHost_FreeType.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698