Skip to content

Commit

Permalink
Merge pull request #1 from ngs/update-font-names
Browse files Browse the repository at this point in the history
Update font names
  • Loading branch information
ngs authored Jul 4, 2022
2 parents dab34fc + d94ff08 commit 2d79c04
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
6 changes: 3 additions & 3 deletions Sources/FontAwesome/FontAwesome.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import SwiftUI
public let version = "6"

func fontAwesomeName(style: Style, pro: Bool) -> String {
let prefix = "Font Awesome \(version)"
let prefix = "FontAwesome\(version)"
switch style {
case .brands, .duotone:
return "\(prefix) \(style.rawValue)"
return "\(prefix)\(style.rawValue)"
default:
return "\(prefix) \(pro ? "Pro" : "Free") \(style.rawValue)"
return "\(prefix)\(pro ? "Pro" : "Free")-\(style.rawValue)"
}
}

Expand Down
4 changes: 2 additions & 2 deletions Sources/FontAwesome/Style.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ public enum Style: String {
case regular = "Regular"
case light = "Light"
case thin = "Thin"
case duotone = "Duotone Solid"
case brands = "Brands Regular"
case duotone = "Duotone-Solid"
case brands = "Brands-Regular"
}
24 changes: 12 additions & 12 deletions Tests/FontAwesomeTests/FontAwesomeTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ import SwiftUI
final class FontAwesomeTests: XCTestCase {
func testNames() throws {
[
(FontAwesome.fontAwesomeName(style: .duotone, pro: false), "Font Awesome 6 Duotone Solid"),
(FontAwesome.fontAwesomeName(style: .duotone, pro: true), "Font Awesome 6 Duotone Solid"),
(FontAwesome.fontAwesomeName(style: .brands, pro: false), "Font Awesome 6 Brands Regular"),
(FontAwesome.fontAwesomeName(style: .brands, pro: true), "Font Awesome 6 Brands Regular"),
(FontAwesome.fontAwesomeName(style: .regular, pro: false), "Font Awesome 6 Free Regular"),
(FontAwesome.fontAwesomeName(style: .regular, pro: true), "Font Awesome 6 Pro Regular"),
(FontAwesome.fontAwesomeName(style: .light, pro: false), "Font Awesome 6 Free Light"),
(FontAwesome.fontAwesomeName(style: .light, pro: true), "Font Awesome 6 Pro Light"),
(FontAwesome.fontAwesomeName(style: .solid, pro: false), "Font Awesome 6 Free Solid"),
(FontAwesome.fontAwesomeName(style: .solid, pro: true), "Font Awesome 6 Pro Solid"),
(FontAwesome.fontAwesomeName(style: .thin, pro: false), "Font Awesome 6 Free Thin"),
(FontAwesome.fontAwesomeName(style: .thin, pro: true), "Font Awesome 6 Pro Thin")
(FontAwesome.fontAwesomeName(style: .duotone, pro: false), "FontAwesome6Duotone-Solid"),
(FontAwesome.fontAwesomeName(style: .duotone, pro: true), "FontAwesome6Duotone-Solid"),
(FontAwesome.fontAwesomeName(style: .brands, pro: false), "FontAwesome6Brands-Regular"),
(FontAwesome.fontAwesomeName(style: .brands, pro: true), "FontAwesome6Brands-Regular"),
(FontAwesome.fontAwesomeName(style: .regular, pro: false), "FontAwesome6Free-Regular"),
(FontAwesome.fontAwesomeName(style: .regular, pro: true), "FontAwesome6Pro-Regular"),
(FontAwesome.fontAwesomeName(style: .light, pro: false), "FontAwesome6Free-Light"),
(FontAwesome.fontAwesomeName(style: .light, pro: true), "FontAwesome6Pro-Light"),
(FontAwesome.fontAwesomeName(style: .solid, pro: false), "FontAwesome6Free-Solid"),
(FontAwesome.fontAwesomeName(style: .solid, pro: true), "FontAwesome6Pro-Solid"),
(FontAwesome.fontAwesomeName(style: .thin, pro: false), "FontAwesome6Free-Thin"),
(FontAwesome.fontAwesomeName(style: .thin, pro: true), "FontAwesome6Pro-Thin")
].forEach { (actual, expected) in
XCTAssertEqual(actual, expected)
}
Expand Down

0 comments on commit 2d79c04

Please sign in to comment.