28 lines
658 B
Swift
28 lines
658 B
Swift
//
|
|
// File.swift
|
|
//
|
|
//
|
|
// Created by Thibaut Schmitt on 13/12/2021.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
|
|
enum FontToolError: Error {
|
|
case fcScan(String, Int32, String?)
|
|
case inputFolderNotFound(String)
|
|
|
|
var description: String {
|
|
switch self {
|
|
case .fcScan(let path, let code, let output):
|
|
return """
|
|
Error while getting fontName (fc-scan --format %{postscriptname} \(path).
|
|
fc-scan exit with \(code) and output is: \(output ?? "no output")
|
|
"""
|
|
|
|
case .inputFolderNotFound(let inputFolder):
|
|
return "Input folder not found: \(inputFolder)"
|
|
}
|
|
}
|
|
}
|