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

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

Issue 574873002: Add onGetFamilyName to SkTypeface. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add .get() for DirectWrite. Created 6 years, 3 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
« no previous file with comments | « src/ports/SkFontHost_fontconfig.cpp ('k') | src/ports/SkFontHost_mac.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 2006 The Android Open Source Project 2 * Copyright 2006 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 "SkFontHost.h" 8 #include "SkFontHost.h"
9 #include "SkFontHost_FreeType_common.h" 9 #include "SkFontHost_FreeType_common.h"
10 #include "SkFontDescriptor.h" 10 #include "SkFontDescriptor.h"
(...skipping 22 matching lines...) Expand all
33 SkTypeface_Custom(Style style, bool isFixedPitch, bool sysFont, const SkStri ng familyName) 33 SkTypeface_Custom(Style style, bool isFixedPitch, bool sysFont, const SkStri ng familyName)
34 : INHERITED(style, SkTypefaceCache::NewFontID(), isFixedPitch) 34 : INHERITED(style, SkTypefaceCache::NewFontID(), isFixedPitch)
35 , fIsSysFont(sysFont), fFamilyName(familyName) 35 , fIsSysFont(sysFont), fFamilyName(familyName)
36 { } 36 { }
37 37
38 bool isSysFont() const { return fIsSysFont; } 38 bool isSysFont() const { return fIsSysFont; }
39 39
40 virtual const char* getUniqueString() const = 0; 40 virtual const char* getUniqueString() const = 0;
41 41
42 protected: 42 protected:
43 virtual void onGetFamilyName(SkString* familyName) const SK_OVERRIDE {
44 *familyName = fFamilyName;
45 }
46
43 virtual void onGetFontDescriptor(SkFontDescriptor* desc, bool* isLocal) cons t SK_OVERRIDE { 47 virtual void onGetFontDescriptor(SkFontDescriptor* desc, bool* isLocal) cons t SK_OVERRIDE {
44 desc->setFamilyName(fFamilyName.c_str()); 48 desc->setFamilyName(fFamilyName.c_str());
45 desc->setFontFileName(this->getUniqueString()); 49 desc->setFontFileName(this->getUniqueString());
46 *isLocal = !this->isSysFont(); 50 *isLocal = !this->isSysFont();
47 } 51 }
48 52
49 private: 53 private:
50 bool fIsSysFont; 54 bool fIsSysFont;
51 SkString fFamilyName; 55 SkString fFamilyName;
52 56
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 } 401 }
398 402
399 SkTArray<SkAutoTUnref<SkFontStyleSet_Custom>, true> fFamilies; 403 SkTArray<SkAutoTUnref<SkFontStyleSet_Custom>, true> fFamilies;
400 SkFontStyleSet_Custom* gDefaultFamily; 404 SkFontStyleSet_Custom* gDefaultFamily;
401 SkTypeface* gDefaultNormal; 405 SkTypeface* gDefaultNormal;
402 }; 406 };
403 407
404 SkFontMgr* SkFontMgr::Factory() { 408 SkFontMgr* SkFontMgr::Factory() {
405 return new SkFontMgr_Custom(SK_FONT_FILE_PREFIX); 409 return new SkFontMgr_Custom(SK_FONT_FILE_PREFIX);
406 } 410 }
OLDNEW
« no previous file with comments | « src/ports/SkFontHost_fontconfig.cpp ('k') | src/ports/SkFontHost_mac.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698