Flutter Engine
platform_mac.mm
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 <TargetConditionals.h>
6 
7 #include "flutter/fml/platform/darwin/platform_version.h"
8 #include "txt/platform.h"
9 
10 #if TARGET_OS_EMBEDDED || TARGET_OS_SIMULATOR
11 #include <UIKit/UIKit.h>
12 #define FONT_CLASS UIFont
13 #else // TARGET_OS_EMBEDDED
14 #include <AppKit/AppKit.h>
15 #define FONT_CLASS NSFont
16 #endif // TARGET_OS_EMBEDDED
17 
18 namespace txt {
19 
20 std::vector<std::string> GetDefaultFontFamilies() {
22  return {[FONT_CLASS systemFontOfSize:14].familyName.UTF8String};
23  } else {
24  return {"Helvetica"};
25  }
26 }
27 
28 sk_sp<SkFontMgr> GetDefaultFontManager() {
29  return SkFontMgr::RefDefault();
30 }
31 
32 } // namespace txt
bool IsPlatformVersionAtLeast(size_t major, size_t minor=0, size_t patch=0)
#define FONT_CLASS
Definition: platform_mac.mm:15
sk_sp< SkFontMgr > GetDefaultFontManager()
Definition: platform.cc:13
std::vector< std::string > GetDefaultFontFamilies()
Definition: platform.cc:9