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

Side by Side Diff: include/ports/SkFontMgr.h

Issue 1438113002: Factor CSS3 matching rules. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Tests can use C++11. Created 5 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
« no previous file with comments | « no previous file | src/core/SkFontMgr.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 2013 Google Inc. 2 * Copyright 2013 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 #ifndef SkFontMgr_DEFINED 8 #ifndef SkFontMgr_DEFINED
9 #define SkFontMgr_DEFINED 9 #define SkFontMgr_DEFINED
10 10
11 #include "SkRefCnt.h" 11 #include "SkRefCnt.h"
12 #include "SkFontStyle.h" 12 #include "SkFontStyle.h"
13 13
14 class SkData; 14 class SkData;
15 class SkFontData; 15 class SkFontData;
16 class SkStreamAsset; 16 class SkStreamAsset;
17 class SkString; 17 class SkString;
18 class SkTypeface; 18 class SkTypeface;
19 19
20 class SK_API SkFontStyleSet : public SkRefCnt { 20 class SK_API SkFontStyleSet : public SkRefCnt {
21 public: 21 public:
22
23
24 virtual int count() = 0; 22 virtual int count() = 0;
25 virtual void getStyle(int index, SkFontStyle*, SkString* style) = 0; 23 virtual void getStyle(int index, SkFontStyle*, SkString* style) = 0;
26 virtual SkTypeface* createTypeface(int index) = 0; 24 virtual SkTypeface* createTypeface(int index) = 0;
27 virtual SkTypeface* matchStyle(const SkFontStyle& pattern) = 0; 25 virtual SkTypeface* matchStyle(const SkFontStyle& pattern) = 0;
28 26
29 static SkFontStyleSet* CreateEmpty(); 27 static SkFontStyleSet* CreateEmpty();
30 28
29 protected:
30 SkTypeface* matchStyleCSS3(const SkFontStyle& pattern);
31
31 private: 32 private:
32 typedef SkRefCnt INHERITED; 33 typedef SkRefCnt INHERITED;
33 }; 34 };
34 35
35 class SkTypeface;
36
37 class SK_API SkFontMgr : public SkRefCnt { 36 class SK_API SkFontMgr : public SkRefCnt {
38 public: 37 public:
39
40
41 int countFamilies() const; 38 int countFamilies() const;
42 void getFamilyName(int index, SkString* familyName) const; 39 void getFamilyName(int index, SkString* familyName) const;
43 SkFontStyleSet* createStyleSet(int index) const; 40 SkFontStyleSet* createStyleSet(int index) const;
44 41
45 /** 42 /**
46 * The caller must call unref() on the returned object. 43 * The caller must call unref() on the returned object.
47 * Never returns NULL; will return an empty set if the name is not found. 44 * Never returns NULL; will return an empty set if the name is not found.
48 * 45 *
49 * It is possible that this will return a style set not accessible from 46 * It is possible that this will return a style set not accessible from
50 * createStyleSet(int) due to hidden or auto-activated fonts. 47 * createStyleSet(int) due to hidden or auto-activated fonts.
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 virtual SkTypeface* onLegacyCreateTypeface(const char familyName[], 142 virtual SkTypeface* onLegacyCreateTypeface(const char familyName[],
146 unsigned styleBits) const = 0; 143 unsigned styleBits) const = 0;
147 private: 144 private:
148 static SkFontMgr* Factory(); // implemented by porting layer 145 static SkFontMgr* Factory(); // implemented by porting layer
149 friend SkFontMgr* sk_fontmgr_create_default(); 146 friend SkFontMgr* sk_fontmgr_create_default();
150 147
151 typedef SkRefCnt INHERITED; 148 typedef SkRefCnt INHERITED;
152 }; 149 };
153 150
154 #endif 151 #endif
OLDNEW
« no previous file with comments | « no previous file | src/core/SkFontMgr.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698