From 05e281f34a0e0e1bbf15c0823f912fb7f4158415 Mon Sep 17 00:00:00 2001 From: Dug Rose Date: Wed, 9 Mar 2016 16:13:28 -0600 Subject: [PATCH] custom fonts with only a few glyphs wont validate this may not be an ideal fix, but the the font works fine even though it does not pass CTFontManagerRegisterGraphicsFont validation... skipping the test for custom fonts works around the issue. --- Swicon/Swicon/Swicon.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Swicon/Swicon/Swicon.swift b/Swicon/Swicon/Swicon.swift index 8a53720..0214ae3 100644 --- a/Swicon/Swicon/Swicon.swift +++ b/Swicon/Swicon/Swicon.swift @@ -214,7 +214,7 @@ private func loadFontFromFile(fontFileName: String, forClass: AnyClass, isCustom let provider = CGDataProviderCreateWithCFData(data) let font = CGFontCreateWithDataProvider(provider)! - if (!CTFontManagerRegisterGraphicsFont(font, nil)) { + if (!CTFontManagerRegisterGraphicsFont(font, nil) && isCustom == false) { NSLog("Failed to load font \(fontFileName)"); return false } else {