未验证 提交 31e5af64 编写于 作者: J Jason Simmons 提交者: GitHub

libtxt: use Helvetica as a fallback font on iOS 8 and earlier (#4930)

Fixes https://github.com/flutter/flutter/issues/16055
上级 c17abdea
......@@ -3,6 +3,7 @@
// found in the LICENSE file.
#include <TargetConditionals.h>
#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
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册