Commit 932fc9c6 by adamdahan

Fix crash in fonts

parent e2d53c9e
......@@ -11,17 +11,26 @@ import UIKit
public struct Roboto {
public static func lightWithSize(size: CGFloat) -> UIFont {
return UIFont(name: "Roboto-Light", size: size)!
if let light = UIFont(name: "Roboto-Light", size: size) {
return light
} else {
return UIFont.systemFontOfSize(size)
}
}
public static func mediumWithSize(size: CGFloat) -> UIFont {
return UIFont(name: "Roboto-Medium", size: size)!
if let light = UIFont(name: "Roboto-Medium", size: size) {
return light
} else {
return UIFont.systemFontOfSize(size)
}
}
public static func regularWithSize(size: CGFloat) -> UIFont {
var fonts = UIFont.fontNamesForFamilyName("Roboto")
println(fonts)
return UIFont(name: "Arial", size: size)!
if let light = UIFont(name: "Roboto-Regular", size: size) {
return light
} else {
return UIFont.systemFontOfSize(size)
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment