Fix legacy round font

This commit is contained in:
Peter 2019-10-29 01:04:17 +04:00
parent 15174de11b
commit a484281304

View File

@ -116,7 +116,13 @@ UIFont *TGFixedSystemFontOfSize(CGFloat size)
+ (UIFont *)roundedFontOfSize:(CGFloat)size
{
return [UIFont fontWithName:@".SFCompactRounded-Semibold" size:size];
if (@available(iOSApplicationExtension 13.0, iOS 13.0, *)) {
UIFontDescriptor *descriptor = [UIFont systemFontOfSize: size].fontDescriptor;
descriptor = [descriptor fontDescriptorWithDesign: UIFontDescriptorSystemDesignRounded];
return [UIFont fontWithDescriptor:descriptor size:size];
} else {
return [UIFont fontWithName:@".SFCompactRounded-Semibold" size:size];
}
}
@end