File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
Sources/YMatterType/Typography Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -56,20 +56,24 @@ public protocol FontRepresentable {
56
56
func accessibilityBoldWeight( for weight: Typography . FontWeight ) -> Typography . FontWeight
57
57
}
58
58
59
+ extension Typography {
60
+ fileprivate static let logger = Logger ( subsystem: " YMatterType " , category: " fonts " )
61
+ }
62
+
59
63
// MARK: - Default implementations
60
64
61
65
extension FontRepresentable {
62
66
public var fontNameSuffix : String { " " }
63
-
67
+
64
68
public func font(
65
69
for weight: Typography . FontWeight ,
66
70
pointSize: CGFloat ,
67
71
compatibleWith traitCollection: UITraitCollection ?
68
72
) -> UIFont {
69
73
let name = fontName ( for: weight, compatibleWith: traitCollection)
70
74
guard let font = UIFont ( name: name, size: pointSize) else {
71
- // Fallback to system font
72
- print ( " Custom font \( name) not properly installed " )
75
+ // Fallback to system font and log a message.
76
+ Typography . logger . warning ( " Custom font \( name) not properly installed. " )
73
77
return FontInfo . system. font (
74
78
for: weight,
75
79
pointSize: pointSize,
You can’t perform that action at this time.
0 commit comments