Adding print statement to display plist data (UIAppFont key)
This commit is contained in:
parent
ce3cac90be
commit
e2150059f7
@ -20,7 +20,7 @@ class FontToolContentGenerator {
|
||||
}
|
||||
|
||||
static func getFontNameEnum(fontsNames: [String]) -> String {
|
||||
var enumDefinition = "\tenum FontName: String {"
|
||||
var enumDefinition = "\tenum FontName: String {\n"
|
||||
|
||||
fontsNames.forEach {
|
||||
//debugPrint("Name: \($0.removeCharacters(from: "[]+-_"))")
|
||||
|
@ -14,7 +14,7 @@ class FontToolHelper {
|
||||
let fileManager = FileManager()
|
||||
|
||||
guard fileManager.fileExists(atPath: inputFolder) else {
|
||||
FontTool.exit(withError: FontToolError.fcScan(path, task.terminationStatus, task.output))
|
||||
FontTool.exit(withError: FontToolError.inputFolderNotFound(inputFolder))
|
||||
}
|
||||
|
||||
let enumerator: FileManager.DirectoryEnumerator = fileManager.enumerator(atPath: inputFolder)!
|
||||
|
@ -38,10 +38,13 @@ struct FontTool: ParsableCommand {
|
||||
extensionFontsMethods,
|
||||
extensionDefinitionClosing)
|
||||
|
||||
print("Info.plist information:")
|
||||
print("\(generatePlistUIAppFonts(fontsNames: fontsData.fontsNames))")
|
||||
|
||||
print("[FontTool] Font generated")
|
||||
}
|
||||
|
||||
func generateExtensionFile(_ args: String...) {
|
||||
private func generateExtensionFile(_ args: String...) {
|
||||
// Create output path
|
||||
let extensionFilePath = "\(extensionOutputPath)/\(extensionName)+Font.swift"
|
||||
|
||||
@ -59,6 +62,17 @@ struct FontTool: ParsableCommand {
|
||||
try! extensionContent.write(to: extensionFilePathURL, atomically: true, encoding: .utf8)
|
||||
}
|
||||
|
||||
private func generatePlistUIAppFonts(fontsNames: [String]) -> String {
|
||||
var plistData = "<key>UIAppFonts</key>\n\t<array>\n"
|
||||
fontsNames
|
||||
.compactMap { $0 }
|
||||
.forEach {
|
||||
plistData += "\t\t<string>\($0)</string>\n"
|
||||
}
|
||||
plistData += "\t</array>\n*/"
|
||||
|
||||
return plistData
|
||||
}
|
||||
// MARK: - Helpers
|
||||
|
||||
private func isUIFontExtension() -> Bool {
|
||||
|
Loading…
x
Reference in New Issue
Block a user