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

Side by Side Diff: src/ports/SkFontHost_win.cpp

Issue 21716005: Add getFamilyNames to SkTypeface. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 4 months 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 | « src/ports/SkFontHost_mac.cpp ('k') | src/ports/SkFontHost_win_dw.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 /* 2 /*
3 * Copyright 2006 The Android Open Source Project 3 * Copyright 2006 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #include "SkAdvancedTypefaceMetrics.h" 9 #include "SkAdvancedTypefaceMetrics.h"
10 #include "SkBase64.h" 10 #include "SkBase64.h"
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 protected: 261 protected:
262 virtual SkStream* onOpenStream(int* ttcIndex) const SK_OVERRIDE; 262 virtual SkStream* onOpenStream(int* ttcIndex) const SK_OVERRIDE;
263 virtual SkScalerContext* onCreateScalerContext(const SkDescriptor*) const SK _OVERRIDE; 263 virtual SkScalerContext* onCreateScalerContext(const SkDescriptor*) const SK _OVERRIDE;
264 virtual void onFilterRec(SkScalerContextRec*) const SK_OVERRIDE; 264 virtual void onFilterRec(SkScalerContextRec*) const SK_OVERRIDE;
265 virtual SkAdvancedTypefaceMetrics* onGetAdvancedTypefaceMetrics( 265 virtual SkAdvancedTypefaceMetrics* onGetAdvancedTypefaceMetrics(
266 SkAdvancedTypefaceMetrics::PerGlyphInfo, 266 SkAdvancedTypefaceMetrics::PerGlyphInfo,
267 const uint32_t*, uint32_t) const SK_OVERRIDE; 267 const uint32_t*, uint32_t) const SK_OVERRIDE;
268 virtual void onGetFontDescriptor(SkFontDescriptor*, bool*) const SK_OVERRIDE ; 268 virtual void onGetFontDescriptor(SkFontDescriptor*, bool*) const SK_OVERRIDE ;
269 virtual int onCountGlyphs() const SK_OVERRIDE; 269 virtual int onCountGlyphs() const SK_OVERRIDE;
270 virtual int onGetUPEM() const SK_OVERRIDE; 270 virtual int onGetUPEM() const SK_OVERRIDE;
271 virtual SkTypeface::LocalizedStrings* onGetFamilyNames() const SK_OVERRIDE; 271 virtual SkTypeface::LocalizedStrings* onCreateFamilyNameIterator() const SK_ OVERRIDE;
272 virtual int onGetTableTags(SkFontTableTag tags[]) const SK_OVERRIDE; 272 virtual int onGetTableTags(SkFontTableTag tags[]) const SK_OVERRIDE;
273 virtual size_t onGetTableData(SkFontTableTag, size_t offset, 273 virtual size_t onGetTableData(SkFontTableTag, size_t offset,
274 size_t length, void* data) const SK_OVERRIDE; 274 size_t length, void* data) const SK_OVERRIDE;
275 virtual SkTypeface* onRefMatchingStyle(Style) const SK_OVERRIDE; 275 virtual SkTypeface* onRefMatchingStyle(Style) const SK_OVERRIDE;
276 }; 276 };
277 277
278 class FontMemResourceTypeface : public LogFontTypeface { 278 class FontMemResourceTypeface : public LogFontTypeface {
279 public: 279 public:
280 /** 280 /**
281 * Takes ownership of fontMemResource. 281 * Takes ownership of fontMemResource.
(...skipping 1767 matching lines...) Expand 10 before | Expand all | Expand 10 after
2049 2049
2050 unsigned int upem = calculateUPEM(hdc, fLogFont); 2050 unsigned int upem = calculateUPEM(hdc, fLogFont);
2051 2051
2052 SelectObject(hdc, savefont); 2052 SelectObject(hdc, savefont);
2053 DeleteObject(font); 2053 DeleteObject(font);
2054 DeleteDC(hdc); 2054 DeleteDC(hdc);
2055 2055
2056 return upem; 2056 return upem;
2057 } 2057 }
2058 2058
2059 SkTypeface::LocalizedStrings* LogFontTypeface::onGetFamilyNames() const { 2059 SkTypeface::LocalizedStrings* LogFontTypeface::onCreateFamilyNameIterator() cons t {
2060 SkTypeface::LocalizedStrings* nameIter = 2060 SkTypeface::LocalizedStrings* nameIter =
2061 SkOTUtils::LocalizedStrings_NameTable::CreateForFamilyNames(*this); 2061 SkOTUtils::LocalizedStrings_NameTable::CreateForFamilyNames(*this);
2062 if (NULL == nameIter) { 2062 if (NULL == nameIter) {
2063 SkString familyName; 2063 SkString familyName;
2064 this->getFamilyName(&familyName); 2064 this->getFamilyName(&familyName);
2065 SkString language("und"); //undetermined 2065 SkString language("und"); //undetermined
2066 nameIter = new SkOTUtils::LocalizedStrings_SingleName(familyName, langua ge); 2066 nameIter = new SkOTUtils::LocalizedStrings_SingleName(familyName, langua ge);
2067 } 2067 }
2068 return nameIter; 2068 return nameIter;
2069 } 2069 }
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
2376 2376
2377 SkTypeface* SkFontHost::CreateTypefaceFromStream(SkStream* stream) { 2377 SkTypeface* SkFontHost::CreateTypefaceFromStream(SkStream* stream) {
2378 return create_from_stream(stream); 2378 return create_from_stream(stream);
2379 } 2379 }
2380 2380
2381 #endif 2381 #endif
2382 2382
2383 SkFontMgr* SkFontMgr::Factory() { 2383 SkFontMgr* SkFontMgr::Factory() {
2384 return SkNEW(SkFontMgrGDI); 2384 return SkNEW(SkFontMgrGDI);
2385 } 2385 }
OLDNEW
« no previous file with comments | « src/ports/SkFontHost_mac.cpp ('k') | src/ports/SkFontHost_win_dw.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698