From e231270437a6cfff5756e32f450723020d639ff1 Mon Sep 17 00:00:00 2001 From: Gary Qian Date: Wed, 5 Jun 2019 16:01:58 -0700 Subject: [PATCH] Add platform_fuchsia.cc for default font on fuchsia (flutter/engine#9204) --- .../flutter/ci/licenses_golden/licenses_flutter | 1 + engine/src/flutter/third_party/txt/BUILD.gn | 2 ++ .../third_party/txt/src/txt/platform_fuchsia.cc | 17 +++++++++++++++++ 3 files changed, 20 insertions(+) create mode 100644 engine/src/flutter/third_party/txt/src/txt/platform_fuchsia.cc diff --git a/engine/src/flutter/ci/licenses_golden/licenses_flutter b/engine/src/flutter/ci/licenses_golden/licenses_flutter index 5ffaf49109..43a5a78f96 100644 --- a/engine/src/flutter/ci/licenses_golden/licenses_flutter +++ b/engine/src/flutter/ci/licenses_golden/licenses_flutter @@ -923,6 +923,7 @@ FILE: ../../../flutter/sky/tools/roll/patches/chromium/android_build.patch FILE: ../../../flutter/third_party/txt/src/txt/platform.cc FILE: ../../../flutter/third_party/txt/src/txt/platform.h FILE: ../../../flutter/third_party/txt/src/txt/platform_android.cc +FILE: ../../../flutter/third_party/txt/src/txt/platform_fuchsia.cc FILE: ../../../flutter/third_party/txt/src/txt/platform_linux.cc FILE: ../../../flutter/third_party/txt/src/txt/platform_mac.mm FILE: ../../../flutter/vulkan/vulkan_application.cc diff --git a/engine/src/flutter/third_party/txt/BUILD.gn b/engine/src/flutter/third_party/txt/BUILD.gn index a8b68b0408..89258bca0b 100644 --- a/engine/src/flutter/third_party/txt/BUILD.gn +++ b/engine/src/flutter/third_party/txt/BUILD.gn @@ -142,6 +142,8 @@ source_set("txt") { sources += [ "src/txt/platform_android.cc" ] } else if (is_linux) { sources += [ "src/txt/platform_linux.cc" ] + } else if (is_fuchsia) { + sources += [ "src/txt/platform_fuchsia.cc" ] } else { sources += [ "src/txt/platform.cc" ] } diff --git a/engine/src/flutter/third_party/txt/src/txt/platform_fuchsia.cc b/engine/src/flutter/third_party/txt/src/txt/platform_fuchsia.cc new file mode 100644 index 0000000000..fd5dc73fcf --- /dev/null +++ b/engine/src/flutter/third_party/txt/src/txt/platform_fuchsia.cc @@ -0,0 +1,17 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "txt/platform.h" + +namespace txt { + +std::string GetDefaultFontFamily() { + return "Roboto"; +} + +sk_sp GetDefaultFontManager() { + return SkFontMgr::RefDefault(); +} + +} // namespace txt