Skip to content

Commit

Permalink
Remove unused Menlo from NSFont.Name
Browse files Browse the repository at this point in the history
  • Loading branch information
1024jp committed Jul 8, 2024
1 parent f4c25ba commit 4cfb04e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
10 changes: 1 addition & 9 deletions CotEditor/Sources/NSFont+Name.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
//
// ---------------------------------------------------------------------------
//
// © 2018-2023 1024jp
// © 2018-2024 1024jp
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -29,7 +29,6 @@ extension NSFont {

enum Name: String {

case menlo = "Menlo"
case avenirNextCondensed = "AvenirNextCondensed"
}

Expand Down Expand Up @@ -73,13 +72,6 @@ private extension NSFont.Name {
private func weightName(of weight: NSFont.Weight) -> String? {

switch self {
case .menlo:
switch weight {
case .regular: "Regular"
case .bold: "Bold"
default: nil
}

case .avenirNextCondensed:
switch weight {
case .ultraLight: "UltraLight"
Expand Down
3 changes: 0 additions & 3 deletions Tests/FontExtensionTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,6 @@ struct FontExtensionTests {

@Test func namedFont() throws {

let menlo = try #require(NSFont(named: .menlo, size: 11))
#expect(menlo == NSFont(name: "Menlo-Regular", size: 11))

let avenirNextCondensed = try #require(NSFont(named: .avenirNextCondensed, weight: .bold, size: 11))
#expect(avenirNextCondensed == NSFont(name: "AvenirNextCondensed-Bold", size: 11))
#expect(avenirNextCondensed.weight.rawValue.isApproximatelyEqual(to: NSFont.Weight.bold.rawValue, relativeTolerance: 0.00001))
Expand Down

0 comments on commit 4cfb04e

Please sign in to comment.