OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2009-2015 Google Inc. | 2 * Copyright 2009-2015 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 /* migrated from chrome/src/skia/ext/SkFontHost_fontconfig_direct.cpp */ | 8 /* migrated from chrome/src/skia/ext/SkFontHost_fontconfig_direct.cpp */ |
9 | 9 |
10 #include "SkFontConfigInterface.h" | 10 #include "SkFontConfigInterface.h" |
11 | 11 |
12 #include <fontconfig/fontconfig.h> | 12 #include <fontconfig/fontconfig.h> |
13 | 13 |
14 class SkFontConfigInterfaceDirect : public SkFontConfigInterface { | 14 class SkFontConfigInterfaceDirect : public SkFontConfigInterface { |
15 public: | 15 public: |
16 SkFontConfigInterfaceDirect(); | 16 SkFontConfigInterfaceDirect(); |
17 ~SkFontConfigInterfaceDirect() override; | 17 ~SkFontConfigInterfaceDirect() override; |
18 | 18 |
19 bool matchFamilyName(const char familyName[], | 19 bool matchFamilyName(const char familyName[], |
20 SkFontStyle requested, | 20 SkFontStyle requested, |
21 FontIdentity* outFontIdentifier, | 21 FontIdentity* outFontIdentifier, |
22 SkString* outFamilyName, | 22 SkString* outFamilyName, |
23 SkFontStyle* outStyle) override; | 23 SkFontStyle* outStyle) override; |
24 | 24 |
25 SkStreamAsset* openStream(const FontIdentity&) override; | 25 SkStreamAsset* openStream(const FontIdentity&) override; |
26 | 26 |
27 // new APIs | 27 // new APIs |
28 SkDataTable* getFamilyNames() override; | 28 sk_sp<SkDataTable> getFamilyNames() override; |
29 | 29 |
30 protected: | 30 protected: |
31 virtual bool isAccessible(const char* filename); | 31 virtual bool isAccessible(const char* filename); |
32 | 32 |
33 private: | 33 private: |
34 bool isValidPattern(FcPattern* pattern); | 34 bool isValidPattern(FcPattern* pattern); |
35 FcPattern* MatchFont(FcFontSet* font_set, const char* post_config_family, | 35 FcPattern* MatchFont(FcFontSet* font_set, const char* post_config_family, |
36 const SkString& family); | 36 const SkString& family); |
37 typedef SkFontConfigInterface INHERITED; | 37 typedef SkFontConfigInterface INHERITED; |
38 }; | 38 }; |
OLD | NEW |