Fix Dynamic Type not applying to status content
This commit is contained in:
parent
176eb7c011
commit
42423f36db
|
@ -3260,7 +3260,7 @@
|
|||
repositoryURL = "https://git.shadowfacts.net/shadowfacts/HTMLStreamer.git";
|
||||
requirement = {
|
||||
kind = exactVersion;
|
||||
version = 0.2.5;
|
||||
version = 0.3.0;
|
||||
};
|
||||
};
|
||||
D63CC700290EC0B8000E19DE /* XCRemoteSwiftPackageReference "sentry-cocoa" */ = {
|
||||
|
|
|
@ -25,8 +25,14 @@ class HTMLConverter {
|
|||
|
||||
private let converter: AttributedStringConverter<Callbacks>
|
||||
|
||||
init(font: UIFont, monospaceFont: UIFont, color: UIColor, paragraphStyle: NSParagraphStyle) {
|
||||
let config = AttributedStringConverterConfiguration(font: font, monospaceFont: monospaceFont, color: color, paragraphStyle: paragraphStyle)
|
||||
init(font: UIFont, monospaceFont: UIFont, fontMetrics: UIFontMetrics, color: UIColor, paragraphStyle: NSParagraphStyle) {
|
||||
let config = AttributedStringConverterConfiguration(
|
||||
font: font,
|
||||
monospaceFont: monospaceFont,
|
||||
fontMetrics: fontMetrics,
|
||||
color: color,
|
||||
paragraphStyle: paragraphStyle
|
||||
)
|
||||
self.converter = AttributedStringConverter(configuration: config)
|
||||
}
|
||||
|
||||
|
|
|
@ -12,6 +12,7 @@ import SwiftUI
|
|||
private var converter = HTMLConverter(
|
||||
font: .preferredFont(forTextStyle: .body),
|
||||
monospaceFont: UIFontMetrics.default.scaledFont(for: .monospacedSystemFont(ofSize: 17, weight: .regular)),
|
||||
fontMetrics: .default,
|
||||
color: .label,
|
||||
paragraphStyle: .default
|
||||
)
|
||||
|
|
|
@ -13,6 +13,7 @@ class ConfirmReblogStatusPreviewView: UIView {
|
|||
private static let htmlConverter = HTMLConverter(
|
||||
font: .preferredFont(forTextStyle: .caption2),
|
||||
monospaceFont: UIFontMetrics(forTextStyle: .caption2).scaledFont(for: .monospacedSystemFont(ofSize: 17, weight: .regular)),
|
||||
fontMetrics: UIFontMetrics(forTextStyle: .caption2),
|
||||
color: .label,
|
||||
paragraphStyle: .default
|
||||
)
|
||||
|
|
|
@ -25,6 +25,7 @@ class ContentTextView: LinkTextView, BaseEmojiLabel {
|
|||
private static let defaultBodyHTMLConverter = HTMLConverter(
|
||||
font: .preferredFont(forTextStyle: .body),
|
||||
monospaceFont: UIFontMetrics.default.scaledFont(for: .monospacedSystemFont(ofSize: 17, weight: .regular)),
|
||||
fontMetrics: .default,
|
||||
color: .label,
|
||||
paragraphStyle: .default
|
||||
)
|
||||
|
|
|
@ -21,6 +21,7 @@ class ProfileFieldValueView: UIView {
|
|||
private static let converter = HTMLConverter(
|
||||
font: .preferredFont(forTextStyle: .body),
|
||||
monospaceFont: UIFontMetrics.default.scaledFont(for: .monospacedSystemFont(ofSize: 17, weight: .regular)),
|
||||
fontMetrics: .default,
|
||||
color: .label,
|
||||
paragraphStyle: .default
|
||||
)
|
||||
|
|
|
@ -20,6 +20,7 @@ class ConversationMainStatusCollectionViewCell: UICollectionViewListCell, Status
|
|||
private static let htmlConverter = HTMLConverter(
|
||||
font: ConversationMainStatusCollectionViewCell.contentFont,
|
||||
monospaceFont: ConversationMainStatusCollectionViewCell.monospaceFont,
|
||||
fontMetrics: .default,
|
||||
color: .label,
|
||||
paragraphStyle: ConversationMainStatusCollectionViewCell.contentParagraphStyle
|
||||
)
|
||||
|
|
|
@ -23,6 +23,7 @@ class TimelineStatusCollectionViewCell: UICollectionViewListCell, StatusCollecti
|
|||
static let htmlConverter = HTMLConverter(
|
||||
font: TimelineStatusCollectionViewCell.contentFont,
|
||||
monospaceFont: TimelineStatusCollectionViewCell.monospaceFont,
|
||||
fontMetrics: .default,
|
||||
color: .label,
|
||||
paragraphStyle: TimelineStatusCollectionViewCell.contentParagraphStyle
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue