Flutter Engine
The Flutter Engine
SkFontConfigInterface_direct.h
Go to the documentation of this file.
1/*
2 * Copyright 2009-2015 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8/* migrated from chrome/src/skia/ext/SkFontHost_fontconfig_direct.cpp */
9#ifndef SKFONTCONFIGINTERFACE_DIRECT_H_
10#define SKFONTCONFIGINTERFACE_DIRECT_H_
11
13
14#include <fontconfig/fontconfig.h>
15
17public:
18 /** Create around a FontConfig instance.
19 * If 'fc' is nullptr, each method call will use the current config.
20 * Takes ownership of 'fc' and will call FcConfigDestroy on it.
21 */
22 SkFontConfigInterfaceDirect(FcConfig* fc);
24
25 bool matchFamilyName(const char familyName[],
26 SkFontStyle requested,
27 FontIdentity* outFontIdentifier,
28 SkString* outFamilyName,
29 SkFontStyle* outStyle) override;
30
31 SkStreamAsset* openStream(const FontIdentity&) override;
32
33protected:
34 virtual bool isAccessible(const char* filename);
35
36private:
37 FcConfig * const fFC;
38 bool isValidPattern(FcPattern* pattern);
39 FcPattern* MatchFont(FcFontSet* font_set, const char* post_config_family,
40 const SkString& family);
42};
43
44#endif
SkStreamAsset * openStream(const FontIdentity &) override
virtual bool isAccessible(const char *filename)
bool matchFamilyName(const char familyName[], SkFontStyle requested, FontIdentity *outFontIdentifier, SkString *outFamilyName, SkFontStyle *outStyle) override