提交 eb56ca3b 编写于 作者: G Giles Payne

Fix build on older Xcode versions

上级 13c6eb42
......@@ -22,11 +22,15 @@ static UIFont* getBodoni72() {
}
static UIFont* getAnySerif() {
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000
if (@available(iOS 13.0, *)) {
return [UIFont fontWithDescriptor:[[UIFontDescriptor preferredFontDescriptorWithTextStyle:UIFontTextStyleBody] fontDescriptorWithDesign:UIFontDescriptorSystemDesignSerif] size:SIZE];
} else {
return nil;
}
#else
return nil;
#endif
}
static UIFont* getSystemFont() {
......
......@@ -22,11 +22,15 @@ static NSFont* getBodoni72() {
}
static NSFont* getAnySerif() {
#if defined(__MAC_OS_X_VERSION_MAX_ALLOWED) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 110000
if (@available(macOS 11.0, *)) {
return [NSFont fontWithDescriptor:[[NSFontDescriptor preferredFontDescriptorForTextStyle:NSFontTextStyleBody options:@{}] fontDescriptorWithDesign:NSFontDescriptorSystemDesignSerif] size:SIZE];
} else {
return nil;
}
#else
return nil;
#endif
}
static NSFont* getSystemFont() {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册