diff --git a/Widget/PeerNode.swift b/Widget/PeerNode.swift index 2e731fdd30..35ebf79119 100644 --- a/Widget/PeerNode.swift +++ b/Widget/PeerNode.swift @@ -13,8 +13,6 @@ private func floorToScreenPixels(_ value: CGFloat) -> CGFloat { return floor(value * UIScreenScale) / UIScreenScale } -private let avatarFont = UIFont(name: ".SFCompactRounded-Semibold", size: 18.0) ?? UIFont.systemFont(ofSize: 18.0) - private let gradientColors: [NSArray] = [ [UIColor(rgb: 0xff516a).cgColor, UIColor(rgb: 0xff885e).cgColor], [UIColor(rgb: 0xffa85c).cgColor, UIColor(rgb: 0xffcd6a).cgColor], diff --git a/submodules/ActionSheetPeerItem/Sources/ActionSheetPeerItem.swift b/submodules/ActionSheetPeerItem/Sources/ActionSheetPeerItem.swift index 8ae9668a7e..d3e81caa6a 100644 --- a/submodules/ActionSheetPeerItem/Sources/ActionSheetPeerItem.swift +++ b/submodules/ActionSheetPeerItem/Sources/ActionSheetPeerItem.swift @@ -43,7 +43,7 @@ public class ActionSheetPeerItem: ActionSheetItem { } } -private let avatarFont = UIFont(name: ".SFCompactRounded-Semibold", size: 15.0)! +private let avatarFont = avatarPlaceholderFont(size: 15.0) public class ActionSheetPeerItemNode: ActionSheetItemNode { private let theme: ActionSheetControllerTheme diff --git a/submodules/AsyncDisplayKit/Source/TextKit/ASTextKitCoreTextAdditions.mm b/submodules/AsyncDisplayKit/Source/TextKit/ASTextKitCoreTextAdditions.mm index e98b236c56..8ae370de14 100644 --- a/submodules/AsyncDisplayKit/Source/TextKit/ASTextKitCoreTextAdditions.mm +++ b/submodules/AsyncDisplayKit/Source/TextKit/ASTextKitCoreTextAdditions.mm @@ -69,15 +69,7 @@ NSDictionary *NSAttributedStringAttributesForCoreTextAttributes(NSDictionary *co // kCTFontAttributeName -> NSFontAttributeName if ([coreTextKey isEqualToString:(NSString *)kCTFontAttributeName]) { CTFontRef coreTextFont = (__bridge CTFontRef)coreTextValue; - NSString *fontName = (__bridge_transfer NSString *)CTFontCopyPostScriptName(coreTextFont); - CGFloat fontSize = CTFontGetSize(coreTextFont); - UIFont *font = [UIFont fontWithName:fontName size:fontSize]; - ASDisplayNodeCAssertNotNil(font, @"unable to load font %@ with size %f", fontName, fontSize); - if (font == nil) { - // Gracefully fail if we were unable to load the font. - font = [UIFont systemFontOfSize:fontSize]; - } - cleanAttributes[NSFontAttributeName] = font; + cleanAttributes[NSFontAttributeName] = (__bridge UIFont *)coreTextFont; } // kCTKernAttributeName -> NSKernAttributeName else if ([coreTextKey isEqualToString:(NSString *)kCTKernAttributeName]) { diff --git a/submodules/AvatarNode/Sources/AvatarNode.swift b/submodules/AvatarNode/Sources/AvatarNode.swift index 0085c2185b..0aed8109da 100644 --- a/submodules/AvatarNode/Sources/AvatarNode.swift +++ b/submodules/AvatarNode/Sources/AvatarNode.swift @@ -14,6 +14,10 @@ private let deletedIcon = UIImage(bundleImageName: "Avatar/DeletedIcon")?.precom private let savedMessagesIcon = generateTintedImage(image: UIImage(bundleImageName: "Avatar/SavedMessagesIcon"), color: .white) private let archivedChatsIcon = UIImage(bundleImageName: "Avatar/ArchiveAvatarIcon")?.precomposed() +public func avatarPlaceholderFont(size: CGFloat) -> UIFont { + return Font.with(size: size, design: .round, traits: [.bold]) +} + public enum AvatarNodeClipStyle { case none case round diff --git a/submodules/CallListUI/Sources/CallListCallItem.swift b/submodules/CallListUI/Sources/CallListCallItem.swift index 178de94a95..0df9fc8f7a 100644 --- a/submodules/CallListUI/Sources/CallListCallItem.swift +++ b/submodules/CallListUI/Sources/CallListCallItem.swift @@ -174,7 +174,7 @@ class CallListCallItem: ListViewItem { } } -private let avatarFont = UIFont(name: ".SFCompactRounded-Semibold", size: 16.0)! +private let avatarFont = avatarPlaceholderFont(size: 16.0) class CallListCallItemNode: ItemListRevealOptionsItemNode { private let backgroundNode: ASDisplayNode diff --git a/submodules/ChatListUI/Sources/Node/ChatListItem.swift b/submodules/ChatListUI/Sources/Node/ChatListItem.swift index ce343e995d..7199f20867 100644 --- a/submodules/ChatListUI/Sources/Node/ChatListItem.swift +++ b/submodules/ChatListUI/Sources/Node/ChatListItem.swift @@ -287,8 +287,6 @@ private final class ChatListItemAccessibilityCustomAction: UIAccessibilityCustom private let separatorHeight = 1.0 / UIScreen.main.scale -private let avatarFont = UIFont(name: ".SFCompactRounded-Semibold", size: 26.0)! - private final class CachedChatListSearchResult { let text: String let searchQuery: String @@ -433,7 +431,7 @@ class ChatListItemNode: ItemListRevealOptionsItemNode { self.backgroundNode.isLayerBacked = true self.backgroundNode.displaysAsynchronously = false - self.avatarNode = AvatarNode(font: avatarFont) + self.avatarNode = AvatarNode(font: avatarPlaceholderFont(size: 26.0)) self.highlightedBackgroundNode = ASDisplayNode() self.highlightedBackgroundNode.isLayerBacked = true diff --git a/submodules/ContactsPeerItem/Sources/ContactsPeerItem.swift b/submodules/ContactsPeerItem/Sources/ContactsPeerItem.swift index 638efe5a7d..98c6650255 100644 --- a/submodules/ContactsPeerItem/Sources/ContactsPeerItem.swift +++ b/submodules/ContactsPeerItem/Sources/ContactsPeerItem.swift @@ -281,7 +281,7 @@ public class ContactsPeerItem: ListViewItem, ListViewItemWithHeader { } } -private let avatarFont = UIFont(name: ".SFCompactRounded-Semibold", size: 16.0)! +private let avatarFont = avatarPlaceholderFont(size: 16.0) public class ContactsPeerItemNode: ItemListRevealOptionsItemNode { private let backgroundNode: ASDisplayNode diff --git a/submodules/DeleteChatPeerActionSheetItem/Sources/DeleteChatPeerActionSheetItem.swift b/submodules/DeleteChatPeerActionSheetItem/Sources/DeleteChatPeerActionSheetItem.swift index db26283320..bbaefbcb19 100644 --- a/submodules/DeleteChatPeerActionSheetItem/Sources/DeleteChatPeerActionSheetItem.swift +++ b/submodules/DeleteChatPeerActionSheetItem/Sources/DeleteChatPeerActionSheetItem.swift @@ -16,6 +16,8 @@ public enum DeleteChatPeerAction { case clearCacheSuggestion } +private let avatarFont = avatarPlaceholderFont(size: 26.0) + public final class DeleteChatPeerActionSheetItem: ActionSheetItem { let context: AccountContext let peer: Peer @@ -41,8 +43,6 @@ public final class DeleteChatPeerActionSheetItem: ActionSheetItem { } } -private let avatarFont = UIFont(name: ".SFCompactRounded-Semibold", size: 26.0)! - private final class DeleteChatPeerActionSheetItemNode: ActionSheetItemNode { private let theme: ActionSheetControllerTheme private let strings: PresentationStrings diff --git a/submodules/Display/Display/Font.swift b/submodules/Display/Display/Font.swift index 30f69df956..73f987b832 100644 --- a/submodules/Display/Display/Font.swift +++ b/submodules/Display/Display/Font.swift @@ -2,6 +2,108 @@ import Foundation import UIKit public struct Font { + public enum Design { + case regular + case serif + case monospace + case round + } + + public struct Traits: OptionSet { + public var rawValue: Int32 + + public init(rawValue: Int32) { + self.rawValue = rawValue + } + + public init() { + self.rawValue = 0 + } + + public static let bold = Traits(rawValue: 1 << 0) + public static let italic = Traits(rawValue: 1 << 1) + } + + public enum Weight { + case regular + case light + case medium + case semibold + case bold + } + + public static func with(size: CGFloat, design: Design = .regular, traits: Traits = []) -> UIFont { + if #available(iOS 13.0, *) { + var descriptor = UIFont.systemFont(ofSize: size).fontDescriptor + var symbolicTraits = descriptor.symbolicTraits + if traits.contains(.bold) { + symbolicTraits.insert(.traitBold) + } + if traits.contains(.italic) { + symbolicTraits.insert(.traitItalic) + } + var updatedDescriptor: UIFontDescriptor? = descriptor.withSymbolicTraits(symbolicTraits) + switch design { + case .serif: + updatedDescriptor = updatedDescriptor?.withDesign(.serif) + case .monospace: + updatedDescriptor = updatedDescriptor?.withDesign(.monospaced) + case .round: + updatedDescriptor = updatedDescriptor?.withDesign(.rounded) + default: + updatedDescriptor = updatedDescriptor?.withDesign(.default) + } + if let updatedDescriptor = updatedDescriptor { + return UIFont(descriptor: updatedDescriptor, size: size) + } else { + return UIFont(descriptor: descriptor, size: size) + } + } else { + switch design { + case .regular: + if traits.contains(.bold) && traits.contains(.italic) { + if let descriptor = UIFont.systemFont(ofSize: size).fontDescriptor.withSymbolicTraits([.traitBold, .traitItalic]) { + return UIFont(descriptor: descriptor, size: size) + } else { + return UIFont.italicSystemFont(ofSize: size) + } + } else if traits.contains(.bold) { + if #available(iOS 8.2, *) { + return UIFont.boldSystemFont(ofSize: size) + } else { + return CTFontCreateWithName("HelveticaNeue-Bold" as CFString, size, nil) + } + } else if traits.contains(.italic) { + return UIFont.italicSystemFont(ofSize: size) + } else { + return UIFont.systemFont(ofSize: size) + } + case .serif: + if traits.contains(.bold) && traits.contains(.italic) { + return UIFont(name: "Georgia-BoldItalic", size: size - 1.0) ?? UIFont.systemFont(ofSize: size) + } else if traits.contains(.bold) { + return UIFont(name: "Georgia-Bold", size: size - 1.0) ?? UIFont.systemFont(ofSize: size) + } else if traits.contains(.italic) { + return UIFont(name: "Georgia-Italic", size: size - 1.0) ?? UIFont.systemFont(ofSize: size) + } else { + return UIFont(name: "Georgia", size: size - 1.0) ?? UIFont.systemFont(ofSize: size) + } + case .monospace: + if traits.contains(.bold) && traits.contains(.italic) { + return UIFont(name: "Menlo-BoldItalic", size: size - 1.0) ?? UIFont.systemFont(ofSize: size) + } else if traits.contains(.bold) { + return UIFont(name: "Menlo-Bold", size: size - 1.0) ?? UIFont.systemFont(ofSize: size) + } else if traits.contains(.italic) { + return UIFont(name: "Menlo-Italic", size: size - 1.0) ?? UIFont.systemFont(ofSize: size) + } else { + return UIFont(name: "Menlo", size: size - 1.0) ?? UIFont.systemFont(ofSize: size) + } + case .round: + return UIFont(name: ".SFCompactRounded-Semibold", size: size) ?? UIFont.systemFont(ofSize: size) + } + } + } + public static func regular(_ size: CGFloat) -> UIFont { return UIFont.systemFont(ofSize: size) } diff --git a/submodules/ItemListAvatarAndNameInfoItem/Sources/ItemListAvatarAndNameItem.swift b/submodules/ItemListAvatarAndNameInfoItem/Sources/ItemListAvatarAndNameItem.swift index ee9d3e6654..1cd6563cae 100644 --- a/submodules/ItemListAvatarAndNameInfoItem/Sources/ItemListAvatarAndNameItem.swift +++ b/submodules/ItemListAvatarAndNameInfoItem/Sources/ItemListAvatarAndNameItem.swift @@ -233,7 +233,7 @@ public class ItemListAvatarAndNameInfoItem: ListViewItem, ItemListItem { } } -private let avatarFont = UIFont(name: ".SFCompactRounded-Semibold", size: 28.0)! +private let avatarFont = avatarPlaceholderFont(size: 28.0) private let nameFont = Font.medium(19.0) private let statusFont = Font.regular(15.0) diff --git a/submodules/ItemListPeerItem/Sources/ItemListPeerItem.swift b/submodules/ItemListPeerItem/Sources/ItemListPeerItem.swift index a4564062e6..06f7e902aa 100644 --- a/submodules/ItemListPeerItem/Sources/ItemListPeerItem.swift +++ b/submodules/ItemListPeerItem/Sources/ItemListPeerItem.swift @@ -216,7 +216,7 @@ private let titleBoldFont = Font.medium(17.0) private let statusFont = Font.regular(14.0) private let labelFont = Font.regular(13.0) private let labelDisclosureFont = Font.regular(17.0) -private let avatarFont = UIFont(name: ".SFCompactRounded-Semibold", size: 15.0)! +private let avatarFont = avatarPlaceholderFont(size: 15.0) private let badgeFont = Font.regular(15.0) public class ItemListPeerItemNode: ItemListRevealOptionsItemNode, ItemListItemNode { diff --git a/submodules/JoinLinkPreviewUI/Sources/JoinLinkPreviewPeerContentNode.swift b/submodules/JoinLinkPreviewUI/Sources/JoinLinkPreviewPeerContentNode.swift index aa15e00e40..7e26d46071 100644 --- a/submodules/JoinLinkPreviewUI/Sources/JoinLinkPreviewPeerContentNode.swift +++ b/submodules/JoinLinkPreviewUI/Sources/JoinLinkPreviewPeerContentNode.swift @@ -11,7 +11,7 @@ import AccountContext import SelectablePeerNode import ShareController -private let avatarFont = UIFont(name: ".SFCompactRounded-Semibold", size: 26.0)! +private let avatarFont = avatarPlaceholderFont(size: 26.0) private final class MoreNode: ASDisplayNode { private let avatarNode = AvatarNode(font: Font.regular(24.0)) diff --git a/submodules/LiveLocationPositionNode/Sources/ChatMessageLiveLocationPositionNode.swift b/submodules/LiveLocationPositionNode/Sources/ChatMessageLiveLocationPositionNode.swift index b3a4b697c4..616168e6b2 100644 --- a/submodules/LiveLocationPositionNode/Sources/ChatMessageLiveLocationPositionNode.swift +++ b/submodules/LiveLocationPositionNode/Sources/ChatMessageLiveLocationPositionNode.swift @@ -9,7 +9,7 @@ import TelegramPresentationData import AvatarNode import AppBundle -private let avatarFont = UIFont(name: ".SFCompactRounded-Semibold", size: 24.0)! +private let avatarFont = avatarPlaceholderFont(size: 24.0) private let avatarBackgroundImage = UIImage(bundleImageName: "Chat/Message/LocationPin")?.precomposed() private func addPulseAnimations(layer: CALayer) { diff --git a/submodules/LiveLocationTimerNode/Sources/ChatMessageLiveLocationTimerNode.swift b/submodules/LiveLocationTimerNode/Sources/ChatMessageLiveLocationTimerNode.swift index eb11af5b82..decfe0fde3 100644 --- a/submodules/LiveLocationTimerNode/Sources/ChatMessageLiveLocationTimerNode.swift +++ b/submodules/LiveLocationTimerNode/Sources/ChatMessageLiveLocationTimerNode.swift @@ -4,7 +4,7 @@ import AsyncDisplayKit import Display import TelegramPresentationData -private let textFont: UIFont = UIFont(name: ".SFCompactRounded-Semibold", size: 13.0)! +private let textFont = Font.with(size: 13.0, design: .round, traits: [.bold]) private class ChatMessageLiveLocationTimerNodeParams: NSObject { let backgroundColor: UIColor diff --git a/submodules/PassportUI/Sources/SecureIdAuthHeaderNode.swift b/submodules/PassportUI/Sources/SecureIdAuthHeaderNode.swift index 99230ac2b0..3e0fda862a 100644 --- a/submodules/PassportUI/Sources/SecureIdAuthHeaderNode.swift +++ b/submodules/PassportUI/Sources/SecureIdAuthHeaderNode.swift @@ -11,7 +11,7 @@ import TelegramUIPreferences import AvatarNode import AppBundle -private let avatarFont = UIFont(name: ".SFCompactRounded-Semibold", size: 26.0)! +private let avatarFont = avatarPlaceholderFont(size: 26.0) private let titleFont = Font.semibold(14.0) private let textFont = Font.regular(14.0) diff --git a/submodules/PeerInfoUI/Sources/ChannelDiscussionGroupActionSheetItem.swift b/submodules/PeerInfoUI/Sources/ChannelDiscussionGroupActionSheetItem.swift index b1ce5b4439..282532c2cd 100644 --- a/submodules/PeerInfoUI/Sources/ChannelDiscussionGroupActionSheetItem.swift +++ b/submodules/PeerInfoUI/Sources/ChannelDiscussionGroupActionSheetItem.swift @@ -34,7 +34,7 @@ final class ChannelDiscussionGroupActionSheetItem: ActionSheetItem { } } -private let avatarFont = UIFont(name: ".SFCompactRounded-Semibold", size: 26.0)! +private let avatarFont = avatarPlaceholderFont(size: 26.0) private final class ChannelDiscussionGroupActionSheetItemNode: ActionSheetItemNode { private let theme: ActionSheetControllerTheme diff --git a/submodules/SelectablePeerNode/Sources/SelectablePeerNode.swift b/submodules/SelectablePeerNode/Sources/SelectablePeerNode.swift index 70204b0144..5116ee9794 100644 --- a/submodules/SelectablePeerNode/Sources/SelectablePeerNode.swift +++ b/submodules/SelectablePeerNode/Sources/SelectablePeerNode.swift @@ -13,7 +13,7 @@ import LegacyComponents import ContextUI import LocalizedPeerData -private let avatarFont = UIFont(name: ".SFCompactRounded-Semibold", size: 24.0)! +private let avatarFont = avatarPlaceholderFont(size: 24.0) private let textFont = Font.regular(11.0) public final class SelectablePeerNodeTheme { diff --git a/submodules/SettingsUI/Sources/Privacy and Security/Recent Sessions/ItemListWebsiteItem.swift b/submodules/SettingsUI/Sources/Privacy and Security/Recent Sessions/ItemListWebsiteItem.swift index 9cc842ea72..9a949e1910 100644 --- a/submodules/SettingsUI/Sources/Privacy and Security/Recent Sessions/ItemListWebsiteItem.swift +++ b/submodules/SettingsUI/Sources/Privacy and Security/Recent Sessions/ItemListWebsiteItem.swift @@ -99,7 +99,7 @@ final class ItemListWebsiteItem: ListViewItem, ItemListItem { } } -private let avatarFont = UIFont(name: ".SFCompactRounded-Semibold", size: 9.0)! +private let avatarFont = avatarPlaceholderFont(size: 9.0) private let titleFont = Font.medium(15.0) private let textFont = Font.regular(13.0) diff --git a/submodules/SettingsUI/Sources/SettingsController.swift b/submodules/SettingsUI/Sources/SettingsController.swift index 13e47c6809..e6dd35ff15 100644 --- a/submodules/SettingsUI/Sources/SettingsController.swift +++ b/submodules/SettingsUI/Sources/SettingsController.swift @@ -38,7 +38,7 @@ import PhoneNumberFormat private let maximumNumberOfAccounts = 3 -private let avatarFont = UIFont(name: ".SFCompactRounded-Semibold", size: 13.0)! +private let avatarFont = avatarPlaceholderFont(size: 13.0) private final class ContextControllerContentSourceImpl: ContextControllerContentSource { let controller: ViewController diff --git a/submodules/SettingsUI/Sources/TabBarAccountSwitchControllerNode.swift b/submodules/SettingsUI/Sources/TabBarAccountSwitchControllerNode.swift index 9f770aca53..dee2138faa 100644 --- a/submodules/SettingsUI/Sources/TabBarAccountSwitchControllerNode.swift +++ b/submodules/SettingsUI/Sources/TabBarAccountSwitchControllerNode.swift @@ -11,7 +11,7 @@ import AccountContext import LocalizedPeerData private let animationDurationFactor: Double = 1.0 -private let avatarFont = UIFont(name: ".SFCompactRounded-Semibold", size: 16.0)! +private let avatarFont = avatarPlaceholderFont(size: 16.0) private protocol AbstractSwitchAccountItemNode { func updateLayout(maxWidth: CGFloat) -> (CGFloat, CGFloat, (CGFloat) -> Void) diff --git a/submodules/ShareController/Sources/SharePeersContainerNode.swift b/submodules/ShareController/Sources/SharePeersContainerNode.swift index 09796a79e2..935fb5039d 100644 --- a/submodules/ShareController/Sources/SharePeersContainerNode.swift +++ b/submodules/ShareController/Sources/SharePeersContainerNode.swift @@ -60,7 +60,7 @@ private struct ShareGridTransaction { let animated: Bool } -private let avatarFont = UIFont(name: ".SFCompactRounded-Semibold", size: 17.0)! +private let avatarFont = avatarPlaceholderFont(size: 17.0) private func preparedGridEntryTransition(account: Account, from fromEntries: [SharePeerEntry], to toEntries: [SharePeerEntry], interfaceInteraction: ShareControllerInteraction) -> ShareGridTransaction { let (deleteIndices, indicesAndItems, updateIndices) = mergeListsStableWithUpdates(leftList: fromEntries, rightList: toEntries) diff --git a/submodules/TelegramBaseController/Sources/LocationBroadcastActionSheetItem.swift b/submodules/TelegramBaseController/Sources/LocationBroadcastActionSheetItem.swift index 8357a9cebd..b39b7b96c8 100644 --- a/submodules/TelegramBaseController/Sources/LocationBroadcastActionSheetItem.swift +++ b/submodules/TelegramBaseController/Sources/LocationBroadcastActionSheetItem.swift @@ -45,7 +45,7 @@ public class LocationBroadcastActionSheetItem: ActionSheetItem { } } -private let avatarFont = UIFont(name: ".SFCompactRounded-Semibold", size: 15.0)! +private let avatarFont = avatarPlaceholderFont(size: 15.0) public class LocationBroadcastActionSheetItemNode: ActionSheetItemNode { private let theme: ActionSheetControllerTheme diff --git a/submodules/TelegramUI/TelegramUI/ChatAvatarNavigationNode.swift b/submodules/TelegramUI/TelegramUI/ChatAvatarNavigationNode.swift index d2344a4d11..e8591415aa 100644 --- a/submodules/TelegramUI/TelegramUI/ChatAvatarNavigationNode.swift +++ b/submodules/TelegramUI/TelegramUI/ChatAvatarNavigationNode.swift @@ -5,8 +5,8 @@ import Display import AvatarNode import ContextUI -private let normalFont = UIFont(name: ".SFCompactRounded-Semibold", size: 16.0)! -private let smallFont = UIFont(name: ".SFCompactRounded-Semibold", size: 12.0)! +private let normalFont = avatarPlaceholderFont(size: 16.0) +private let smallFont = avatarPlaceholderFont(size: 12.0) final class ChatAvatarNavigationNodeView: UIView, PreviewingHostView { var previewingDelegate: PreviewingHostViewDelegate? { diff --git a/submodules/TelegramUI/TelegramUI/ChatMediaInputPeerSpecificItem.swift b/submodules/TelegramUI/TelegramUI/ChatMediaInputPeerSpecificItem.swift index 0559145cf9..cbef9e9360 100644 --- a/submodules/TelegramUI/TelegramUI/ChatMediaInputPeerSpecificItem.swift +++ b/submodules/TelegramUI/TelegramUI/ChatMediaInputPeerSpecificItem.swift @@ -60,7 +60,7 @@ final class ChatMediaInputPeerSpecificItem: ListViewItem { } } -private let avatarFont = UIFont(name: ".SFCompactRounded-Semibold", size: 12.0)! +private let avatarFont = avatarPlaceholderFont(size: 12.0) private let boundingSize = CGSize(width: 41.0, height: 41.0) private let boundingImageSize = CGSize(width: 28.0, height: 28.0) private let highlightSize = CGSize(width: 35.0, height: 35.0) diff --git a/submodules/TelegramUI/TelegramUI/ChatMessageAvatarAccessoryItem.swift b/submodules/TelegramUI/TelegramUI/ChatMessageAvatarAccessoryItem.swift index 1b14067218..0d1c676c29 100644 --- a/submodules/TelegramUI/TelegramUI/ChatMessageAvatarAccessoryItem.swift +++ b/submodules/TelegramUI/TelegramUI/ChatMessageAvatarAccessoryItem.swift @@ -8,7 +8,7 @@ import TelegramPresentationData import AvatarNode import AccountContext -private let avatarFont = UIFont(name: ".SFCompactRounded-Semibold", size: 16.0)! +private let avatarFont = avatarPlaceholderFont(size: 16.0) final class ChatMessageAvatarAccessoryItem: ListViewAccessoryItem { private let context: AccountContext diff --git a/submodules/TelegramUI/TelegramUI/ChatMessageContactBubbleContentNode.swift b/submodules/TelegramUI/TelegramUI/ChatMessageContactBubbleContentNode.swift index da8fa477f0..5523ff8921 100644 --- a/submodules/TelegramUI/TelegramUI/ChatMessageContactBubbleContentNode.swift +++ b/submodules/TelegramUI/TelegramUI/ChatMessageContactBubbleContentNode.swift @@ -11,7 +11,7 @@ import AvatarNode import AccountContext import PhoneNumberFormat -private let avatarFont = UIFont(name: ".SFCompactRounded-Semibold", size: 16.0)! +private let avatarFont = avatarPlaceholderFont(size: 16.0) private let titleFont = Font.medium(14.0) private let textFont = Font.regular(14.0) diff --git a/submodules/TelegramUI/TelegramUI/ChatMessageNotificationItem.swift b/submodules/TelegramUI/TelegramUI/ChatMessageNotificationItem.swift index 21187109ce..58f045c4f9 100644 --- a/submodules/TelegramUI/TelegramUI/ChatMessageNotificationItem.swift +++ b/submodules/TelegramUI/TelegramUI/ChatMessageNotificationItem.swift @@ -57,8 +57,8 @@ public final class ChatMessageNotificationItem: NotificationItem { } } -private let compactAvatarFont = UIFont(name: ".SFCompactRounded-Semibold", size: 20.0)! -private let avatarFont = UIFont(name: ".SFCompactRounded-Semibold", size: 24.0)! +private let compactAvatarFont = avatarPlaceholderFont(size: 20.0) +private let avatarFont = avatarPlaceholderFont(size: 24.0) final class ChatMessageNotificationItemNode: NotificationItemNode { private var item: ChatMessageNotificationItem? diff --git a/submodules/TelegramUI/TelegramUI/CommandChatInputPanelItem.swift b/submodules/TelegramUI/TelegramUI/CommandChatInputPanelItem.swift index 2701dcea01..a6e08d4cab 100644 --- a/submodules/TelegramUI/TelegramUI/CommandChatInputPanelItem.swift +++ b/submodules/TelegramUI/TelegramUI/CommandChatInputPanelItem.swift @@ -76,7 +76,7 @@ final class CommandChatInputPanelItem: ListViewItem { } } -private let avatarFont = UIFont(name: ".SFCompactRounded-Semibold", size: 16.0)! +private let avatarFont = avatarPlaceholderFont(size: 16.0) private let textFont = Font.medium(14.0) private let descriptionFont = Font.regular(14.0) diff --git a/submodules/TelegramUI/TelegramUI/MentionChatInputPanelItem.swift b/submodules/TelegramUI/TelegramUI/MentionChatInputPanelItem.swift index 600e3654aa..7c65cb7dd8 100644 --- a/submodules/TelegramUI/TelegramUI/MentionChatInputPanelItem.swift +++ b/submodules/TelegramUI/TelegramUI/MentionChatInputPanelItem.swift @@ -78,7 +78,7 @@ final class MentionChatInputPanelItem: ListViewItem { } } -private let avatarFont = UIFont(name: ".SFCompactRounded-Semibold", size: 16.0)! +private let avatarFont = avatarPlaceholderFont(size: 16.0) private let primaryFont = Font.medium(14.0) private let secondaryFont = Font.regular(14.0) diff --git a/submodules/WebSearchUI/Sources/WebSearchBadgeNode.swift b/submodules/WebSearchUI/Sources/WebSearchBadgeNode.swift index 9487ecd225..36dd99037d 100644 --- a/submodules/WebSearchUI/Sources/WebSearchBadgeNode.swift +++ b/submodules/WebSearchUI/Sources/WebSearchBadgeNode.swift @@ -12,7 +12,7 @@ final class WebSearchBadgeNode: ASDisplayNode { private let textNode: ASTextNode private let backgroundNode: ASImageNode - private let font: UIFont = UIFont(name: ".SFCompactRounded-Semibold", size: 17.0)! + private let font: UIFont = Font.with(size: 17.0, design: .round, traits: [.bold]) var text: String = "" { didSet { diff --git a/submodules/rlottie/rlottie b/submodules/rlottie/rlottie index 699d822fc5..a09896b3e7 160000 --- a/submodules/rlottie/rlottie +++ b/submodules/rlottie/rlottie @@ -1 +1 @@ -Subproject commit 699d822fc547e6d9b997667f8d5aecf75182d0a3 +Subproject commit a09896b3e72e76681c12e80572a7d570108cf885