mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-11-07 09:20:08 +00:00
Fix serif-font bug and round font in avatar placeholders
This commit is contained in:
parent
f721a92605
commit
61f71dfcb2
@ -13,8 +13,6 @@ private func floorToScreenPixels(_ value: CGFloat) -> CGFloat {
|
|||||||
return floor(value * UIScreenScale) / UIScreenScale
|
return floor(value * UIScreenScale) / UIScreenScale
|
||||||
}
|
}
|
||||||
|
|
||||||
private let avatarFont = UIFont(name: ".SFCompactRounded-Semibold", size: 18.0) ?? UIFont.systemFont(ofSize: 18.0)
|
|
||||||
|
|
||||||
private let gradientColors: [NSArray] = [
|
private let gradientColors: [NSArray] = [
|
||||||
[UIColor(rgb: 0xff516a).cgColor, UIColor(rgb: 0xff885e).cgColor],
|
[UIColor(rgb: 0xff516a).cgColor, UIColor(rgb: 0xff885e).cgColor],
|
||||||
[UIColor(rgb: 0xffa85c).cgColor, UIColor(rgb: 0xffcd6a).cgColor],
|
[UIColor(rgb: 0xffa85c).cgColor, UIColor(rgb: 0xffcd6a).cgColor],
|
||||||
|
|||||||
@ -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 {
|
public class ActionSheetPeerItemNode: ActionSheetItemNode {
|
||||||
private let theme: ActionSheetControllerTheme
|
private let theme: ActionSheetControllerTheme
|
||||||
|
|||||||
@ -69,15 +69,7 @@ NSDictionary *NSAttributedStringAttributesForCoreTextAttributes(NSDictionary *co
|
|||||||
// kCTFontAttributeName -> NSFontAttributeName
|
// kCTFontAttributeName -> NSFontAttributeName
|
||||||
if ([coreTextKey isEqualToString:(NSString *)kCTFontAttributeName]) {
|
if ([coreTextKey isEqualToString:(NSString *)kCTFontAttributeName]) {
|
||||||
CTFontRef coreTextFont = (__bridge CTFontRef)coreTextValue;
|
CTFontRef coreTextFont = (__bridge CTFontRef)coreTextValue;
|
||||||
NSString *fontName = (__bridge_transfer NSString *)CTFontCopyPostScriptName(coreTextFont);
|
cleanAttributes[NSFontAttributeName] = (__bridge UIFont *)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;
|
|
||||||
}
|
}
|
||||||
// kCTKernAttributeName -> NSKernAttributeName
|
// kCTKernAttributeName -> NSKernAttributeName
|
||||||
else if ([coreTextKey isEqualToString:(NSString *)kCTKernAttributeName]) {
|
else if ([coreTextKey isEqualToString:(NSString *)kCTKernAttributeName]) {
|
||||||
|
|||||||
@ -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 savedMessagesIcon = generateTintedImage(image: UIImage(bundleImageName: "Avatar/SavedMessagesIcon"), color: .white)
|
||||||
private let archivedChatsIcon = UIImage(bundleImageName: "Avatar/ArchiveAvatarIcon")?.precomposed()
|
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 {
|
public enum AvatarNodeClipStyle {
|
||||||
case none
|
case none
|
||||||
case round
|
case round
|
||||||
|
|||||||
@ -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 {
|
class CallListCallItemNode: ItemListRevealOptionsItemNode {
|
||||||
private let backgroundNode: ASDisplayNode
|
private let backgroundNode: ASDisplayNode
|
||||||
|
|||||||
@ -287,8 +287,6 @@ private final class ChatListItemAccessibilityCustomAction: UIAccessibilityCustom
|
|||||||
|
|
||||||
private let separatorHeight = 1.0 / UIScreen.main.scale
|
private let separatorHeight = 1.0 / UIScreen.main.scale
|
||||||
|
|
||||||
private let avatarFont = UIFont(name: ".SFCompactRounded-Semibold", size: 26.0)!
|
|
||||||
|
|
||||||
private final class CachedChatListSearchResult {
|
private final class CachedChatListSearchResult {
|
||||||
let text: String
|
let text: String
|
||||||
let searchQuery: String
|
let searchQuery: String
|
||||||
@ -433,7 +431,7 @@ class ChatListItemNode: ItemListRevealOptionsItemNode {
|
|||||||
self.backgroundNode.isLayerBacked = true
|
self.backgroundNode.isLayerBacked = true
|
||||||
self.backgroundNode.displaysAsynchronously = false
|
self.backgroundNode.displaysAsynchronously = false
|
||||||
|
|
||||||
self.avatarNode = AvatarNode(font: avatarFont)
|
self.avatarNode = AvatarNode(font: avatarPlaceholderFont(size: 26.0))
|
||||||
|
|
||||||
self.highlightedBackgroundNode = ASDisplayNode()
|
self.highlightedBackgroundNode = ASDisplayNode()
|
||||||
self.highlightedBackgroundNode.isLayerBacked = true
|
self.highlightedBackgroundNode.isLayerBacked = true
|
||||||
|
|||||||
@ -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 {
|
public class ContactsPeerItemNode: ItemListRevealOptionsItemNode {
|
||||||
private let backgroundNode: ASDisplayNode
|
private let backgroundNode: ASDisplayNode
|
||||||
|
|||||||
@ -16,6 +16,8 @@ public enum DeleteChatPeerAction {
|
|||||||
case clearCacheSuggestion
|
case clearCacheSuggestion
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private let avatarFont = avatarPlaceholderFont(size: 26.0)
|
||||||
|
|
||||||
public final class DeleteChatPeerActionSheetItem: ActionSheetItem {
|
public final class DeleteChatPeerActionSheetItem: ActionSheetItem {
|
||||||
let context: AccountContext
|
let context: AccountContext
|
||||||
let peer: Peer
|
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 final class DeleteChatPeerActionSheetItemNode: ActionSheetItemNode {
|
||||||
private let theme: ActionSheetControllerTheme
|
private let theme: ActionSheetControllerTheme
|
||||||
private let strings: PresentationStrings
|
private let strings: PresentationStrings
|
||||||
|
|||||||
@ -2,6 +2,108 @@ import Foundation
|
|||||||
import UIKit
|
import UIKit
|
||||||
|
|
||||||
public struct Font {
|
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 {
|
public static func regular(_ size: CGFloat) -> UIFont {
|
||||||
return UIFont.systemFont(ofSize: size)
|
return UIFont.systemFont(ofSize: size)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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 nameFont = Font.medium(19.0)
|
||||||
private let statusFont = Font.regular(15.0)
|
private let statusFont = Font.regular(15.0)
|
||||||
|
|
||||||
|
|||||||
@ -216,7 +216,7 @@ private let titleBoldFont = Font.medium(17.0)
|
|||||||
private let statusFont = Font.regular(14.0)
|
private let statusFont = Font.regular(14.0)
|
||||||
private let labelFont = Font.regular(13.0)
|
private let labelFont = Font.regular(13.0)
|
||||||
private let labelDisclosureFont = Font.regular(17.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)
|
private let badgeFont = Font.regular(15.0)
|
||||||
|
|
||||||
public class ItemListPeerItemNode: ItemListRevealOptionsItemNode, ItemListItemNode {
|
public class ItemListPeerItemNode: ItemListRevealOptionsItemNode, ItemListItemNode {
|
||||||
|
|||||||
@ -11,7 +11,7 @@ import AccountContext
|
|||||||
import SelectablePeerNode
|
import SelectablePeerNode
|
||||||
import ShareController
|
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 final class MoreNode: ASDisplayNode {
|
||||||
private let avatarNode = AvatarNode(font: Font.regular(24.0))
|
private let avatarNode = AvatarNode(font: Font.regular(24.0))
|
||||||
|
|||||||
@ -9,7 +9,7 @@ import TelegramPresentationData
|
|||||||
import AvatarNode
|
import AvatarNode
|
||||||
import AppBundle
|
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 let avatarBackgroundImage = UIImage(bundleImageName: "Chat/Message/LocationPin")?.precomposed()
|
||||||
|
|
||||||
private func addPulseAnimations(layer: CALayer) {
|
private func addPulseAnimations(layer: CALayer) {
|
||||||
|
|||||||
@ -4,7 +4,7 @@ import AsyncDisplayKit
|
|||||||
import Display
|
import Display
|
||||||
import TelegramPresentationData
|
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 {
|
private class ChatMessageLiveLocationTimerNodeParams: NSObject {
|
||||||
let backgroundColor: UIColor
|
let backgroundColor: UIColor
|
||||||
|
|||||||
@ -11,7 +11,7 @@ import TelegramUIPreferences
|
|||||||
import AvatarNode
|
import AvatarNode
|
||||||
import AppBundle
|
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 titleFont = Font.semibold(14.0)
|
||||||
private let textFont = Font.regular(14.0)
|
private let textFont = Font.regular(14.0)
|
||||||
|
|
||||||
|
|||||||
@ -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 final class ChannelDiscussionGroupActionSheetItemNode: ActionSheetItemNode {
|
||||||
private let theme: ActionSheetControllerTheme
|
private let theme: ActionSheetControllerTheme
|
||||||
|
|||||||
@ -13,7 +13,7 @@ import LegacyComponents
|
|||||||
import ContextUI
|
import ContextUI
|
||||||
import LocalizedPeerData
|
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)
|
private let textFont = Font.regular(11.0)
|
||||||
|
|
||||||
public final class SelectablePeerNodeTheme {
|
public final class SelectablePeerNodeTheme {
|
||||||
|
|||||||
@ -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 titleFont = Font.medium(15.0)
|
||||||
private let textFont = Font.regular(13.0)
|
private let textFont = Font.regular(13.0)
|
||||||
|
|
||||||
|
|||||||
@ -38,7 +38,7 @@ import PhoneNumberFormat
|
|||||||
|
|
||||||
private let maximumNumberOfAccounts = 3
|
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 {
|
private final class ContextControllerContentSourceImpl: ContextControllerContentSource {
|
||||||
let controller: ViewController
|
let controller: ViewController
|
||||||
|
|||||||
@ -11,7 +11,7 @@ import AccountContext
|
|||||||
import LocalizedPeerData
|
import LocalizedPeerData
|
||||||
|
|
||||||
private let animationDurationFactor: Double = 1.0
|
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 {
|
private protocol AbstractSwitchAccountItemNode {
|
||||||
func updateLayout(maxWidth: CGFloat) -> (CGFloat, CGFloat, (CGFloat) -> Void)
|
func updateLayout(maxWidth: CGFloat) -> (CGFloat, CGFloat, (CGFloat) -> Void)
|
||||||
|
|||||||
@ -60,7 +60,7 @@ private struct ShareGridTransaction {
|
|||||||
let animated: Bool
|
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 {
|
private func preparedGridEntryTransition(account: Account, from fromEntries: [SharePeerEntry], to toEntries: [SharePeerEntry], interfaceInteraction: ShareControllerInteraction) -> ShareGridTransaction {
|
||||||
let (deleteIndices, indicesAndItems, updateIndices) = mergeListsStableWithUpdates(leftList: fromEntries, rightList: toEntries)
|
let (deleteIndices, indicesAndItems, updateIndices) = mergeListsStableWithUpdates(leftList: fromEntries, rightList: toEntries)
|
||||||
|
|||||||
@ -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 {
|
public class LocationBroadcastActionSheetItemNode: ActionSheetItemNode {
|
||||||
private let theme: ActionSheetControllerTheme
|
private let theme: ActionSheetControllerTheme
|
||||||
|
|||||||
@ -5,8 +5,8 @@ import Display
|
|||||||
import AvatarNode
|
import AvatarNode
|
||||||
import ContextUI
|
import ContextUI
|
||||||
|
|
||||||
private let normalFont = UIFont(name: ".SFCompactRounded-Semibold", size: 16.0)!
|
private let normalFont = avatarPlaceholderFont(size: 16.0)
|
||||||
private let smallFont = UIFont(name: ".SFCompactRounded-Semibold", size: 12.0)!
|
private let smallFont = avatarPlaceholderFont(size: 12.0)
|
||||||
|
|
||||||
final class ChatAvatarNavigationNodeView: UIView, PreviewingHostView {
|
final class ChatAvatarNavigationNodeView: UIView, PreviewingHostView {
|
||||||
var previewingDelegate: PreviewingHostViewDelegate? {
|
var previewingDelegate: PreviewingHostViewDelegate? {
|
||||||
|
|||||||
@ -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 boundingSize = CGSize(width: 41.0, height: 41.0)
|
||||||
private let boundingImageSize = CGSize(width: 28.0, height: 28.0)
|
private let boundingImageSize = CGSize(width: 28.0, height: 28.0)
|
||||||
private let highlightSize = CGSize(width: 35.0, height: 35.0)
|
private let highlightSize = CGSize(width: 35.0, height: 35.0)
|
||||||
|
|||||||
@ -8,7 +8,7 @@ import TelegramPresentationData
|
|||||||
import AvatarNode
|
import AvatarNode
|
||||||
import AccountContext
|
import AccountContext
|
||||||
|
|
||||||
private let avatarFont = UIFont(name: ".SFCompactRounded-Semibold", size: 16.0)!
|
private let avatarFont = avatarPlaceholderFont(size: 16.0)
|
||||||
|
|
||||||
final class ChatMessageAvatarAccessoryItem: ListViewAccessoryItem {
|
final class ChatMessageAvatarAccessoryItem: ListViewAccessoryItem {
|
||||||
private let context: AccountContext
|
private let context: AccountContext
|
||||||
|
|||||||
@ -11,7 +11,7 @@ import AvatarNode
|
|||||||
import AccountContext
|
import AccountContext
|
||||||
import PhoneNumberFormat
|
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 titleFont = Font.medium(14.0)
|
||||||
private let textFont = Font.regular(14.0)
|
private let textFont = Font.regular(14.0)
|
||||||
|
|||||||
@ -57,8 +57,8 @@ public final class ChatMessageNotificationItem: NotificationItem {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private let compactAvatarFont = UIFont(name: ".SFCompactRounded-Semibold", size: 20.0)!
|
private let compactAvatarFont = avatarPlaceholderFont(size: 20.0)
|
||||||
private let avatarFont = UIFont(name: ".SFCompactRounded-Semibold", size: 24.0)!
|
private let avatarFont = avatarPlaceholderFont(size: 24.0)
|
||||||
|
|
||||||
final class ChatMessageNotificationItemNode: NotificationItemNode {
|
final class ChatMessageNotificationItemNode: NotificationItemNode {
|
||||||
private var item: ChatMessageNotificationItem?
|
private var item: ChatMessageNotificationItem?
|
||||||
|
|||||||
@ -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 textFont = Font.medium(14.0)
|
||||||
private let descriptionFont = Font.regular(14.0)
|
private let descriptionFont = Font.regular(14.0)
|
||||||
|
|
||||||
|
|||||||
@ -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 primaryFont = Font.medium(14.0)
|
||||||
private let secondaryFont = Font.regular(14.0)
|
private let secondaryFont = Font.regular(14.0)
|
||||||
|
|
||||||
|
|||||||
@ -12,7 +12,7 @@ final class WebSearchBadgeNode: ASDisplayNode {
|
|||||||
private let textNode: ASTextNode
|
private let textNode: ASTextNode
|
||||||
private let backgroundNode: ASImageNode
|
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 = "" {
|
var text: String = "" {
|
||||||
didSet {
|
didSet {
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
Subproject commit 699d822fc547e6d9b997667f8d5aecf75182d0a3
|
Subproject commit a09896b3e72e76681c12e80572a7d570108cf885
|
||||||
Loading…
x
Reference in New Issue
Block a user