Flutter Engine
The Flutter Engine
platform_linux.cc
Go to the documentation of this file.
1// Copyright 2013 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "txt/platform.h"
6
7#if defined(SK_FONTMGR_FONTCONFIG_AVAILABLE)
9#endif
10
11#if defined(SK_FONTMGR_FREETYPE_DIRECTORY_AVAILABLE)
13#endif
14
15#if defined(SK_FONTMGR_FREETYPE_EMPTY_AVAILABLE)
17#endif
18
19namespace txt {
20
21std::vector<std::string> GetDefaultFontFamilies() {
22 return {"Ubuntu", "Cantarell", "DejaVu Sans", "Liberation Sans", "Arial"};
23}
24
25sk_sp<SkFontMgr> GetDefaultFontManager(uint32_t font_initialization_data) {
26#if defined(SK_FONTMGR_FONTCONFIG_AVAILABLE)
27 static sk_sp<SkFontMgr> mgr = SkFontMgr_New_FontConfig(nullptr);
28#elif defined(SK_FONTMGR_FREETYPE_DIRECTORY_AVAILABLE)
29 static sk_sp<SkFontMgr> mgr =
30 SkFontMgr_New_Custom_Directory("/usr/share/fonts/");
31#elif defined(SK_FONTMGR_FREETYPE_EMPTY_AVAILABLE)
33#else
35#endif
36 return mgr;
37}
38
39} // namespace txt
SK_API sk_sp< SkFontMgr > SkFontMgr_New_Custom_Directory(const char *dir)
SK_API sk_sp< SkFontMgr > SkFontMgr_New_Custom_Empty()
SK_API sk_sp< SkFontMgr > SkFontMgr_New_FontConfig(FcConfig *fc)
static sk_sp< SkFontMgr > RefEmpty()
Definition: SkFontMgr.cpp:154
std::vector< std::string > GetDefaultFontFamilies()
Definition: platform.cc:13
sk_sp< SkFontMgr > GetDefaultFontManager(uint32_t font_initialization_data)
Definition: platform.cc:17