From 414fef2430abdae9d0f4fb2fd9d2d952c2dd40b0 Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Wed, 4 Apr 2018 09:37:51 -0700 Subject: [PATCH] libtxt: use Helvetica as a fallback font on iOS 8 and earlier (flutter/engine#4930) Fixes https://github.com/flutter/flutter/issues/16055 --- engine/src/flutter/third_party/txt/src/txt/platform_mac.mm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/engine/src/flutter/third_party/txt/src/txt/platform_mac.mm b/engine/src/flutter/third_party/txt/src/txt/platform_mac.mm index 8b6bb9c33c..9a97e06f09 100644 --- a/engine/src/flutter/third_party/txt/src/txt/platform_mac.mm +++ b/engine/src/flutter/third_party/txt/src/txt/platform_mac.mm @@ -3,6 +3,7 @@ // found in the LICENSE file. #include +#include "flutter/fml/platform/darwin/platform_version.h" #include "txt/platform.h" #if TARGET_OS_EMBEDDED || TARGET_OS_SIMULATOR @@ -16,7 +17,11 @@ namespace txt { std::string GetDefaultFontFamily() { - return [FONT_CLASS systemFontOfSize:14].familyName.UTF8String; + if (fml::IsPlatformVersionAtLeast(9)) { + return [FONT_CLASS systemFontOfSize:14].familyName.UTF8String; + } else { + return "Helvetica"; + } } } // namespace txt