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 #ifdef FLUTTER_USE_FONTCONFIG
8 #include "third_party/skia/include/ports/SkFontMgr_fontconfig.h"
9 #else
10 #include "third_party/skia/include/ports/SkFontMgr_directory.h"
11 #endif
12 
13 namespace txt {
14 
15 std::vector<std::string> GetDefaultFontFamilies() {
16  return {"Ubuntu", "Cantarell", "DejaVu Sans", "Liberation Sans", "Arial"};
17 }
18 
19 sk_sp<SkFontMgr> GetDefaultFontManager() {
20 #ifdef FLUTTER_USE_FONTCONFIG
21  return SkFontMgr_New_FontConfig(nullptr);
22 #else
23  return SkFontMgr_New_Custom_Directory("/usr/share/fonts/");
24 #endif
25 }
26 
27 } // namespace txt
sk_sp< SkFontMgr > GetDefaultFontManager()
Definition: platform.cc:13
std::vector< std::string > GetDefaultFontFamilies()
Definition: platform.cc:9