wip
This commit is contained in:
@@ -7,11 +7,21 @@ struct TextStyle: Decodable {
|
||||
var textAlign: String? = "auto"
|
||||
var lineHeight: Double?
|
||||
var textDecorationLine: TextDecorationLine?
|
||||
var flex: Int?
|
||||
}
|
||||
|
||||
enum FontWeight: String, Decodable {
|
||||
case bold
|
||||
case normal
|
||||
case one = "100"
|
||||
case two = "200"
|
||||
case three = "300"
|
||||
case four = "400"
|
||||
case five = "500"
|
||||
case six = "600"
|
||||
case seven = "700"
|
||||
case eight = "800"
|
||||
case nine = "900"
|
||||
|
||||
func toFontWeight() -> UIFont.Weight {
|
||||
switch self {
|
||||
@@ -19,6 +29,24 @@ enum FontWeight: String, Decodable {
|
||||
return .bold
|
||||
case .normal:
|
||||
return .regular
|
||||
case .one:
|
||||
return .ultraLight
|
||||
case .two:
|
||||
return .ultraLight
|
||||
case .three:
|
||||
return .light
|
||||
case .four:
|
||||
return .regular
|
||||
case .five:
|
||||
return .medium
|
||||
case .six:
|
||||
return .semibold
|
||||
case .seven:
|
||||
return .semibold
|
||||
case .eight:
|
||||
return .bold
|
||||
case .nine:
|
||||
return .heavy
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -27,5 +55,6 @@ enum TextDecorationLine: String, Decodable {
|
||||
case underline
|
||||
case lineThrough = "line-through"
|
||||
case underlineLineThrough = "underline line-through"
|
||||
|
||||
case normal
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user