From 1f6a88166fc19d389d24cad87ba3cc46101ec53a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A2=9C=E4=B8=BA=E6=99=A8?= <417495814@qq.com> Date: Mon, 12 Sep 2016 19:29:00 +0800 Subject: [PATCH] 0.0.2 --- .DS_Store | Bin 6148 -> 6148 bytes .../project.pbxproj | 95 ++++++---- .../contents.xcworkspacedata | 0 .../UserInterfaceState.xcuserstate | Bin 0 -> 28676 bytes .../xcdebugger/Breakpoints_v2.xcbkptlist | 5 + .../xcschemes/Fonty-Demo.xcscheme | 0 .../xcschemes/xcschememanagement.plist | 0 Fonty-Demo/{Fonty-Demo => }/AppDelegate.h | 0 Fonty-Demo/{Fonty-Demo => }/AppDelegate.m | 0 .../AppIcon.appiconset/Contents.json | 0 .../Base.lproj/LaunchScreen.storyboard | 0 .../Base.lproj/Main.storyboard | 0 Fonty-Demo/FYSelectFontTableViewCell.h | 13 ++ Fonty-Demo/FYSelectFontTableViewCell.m | 16 ++ Fonty-Demo/FYSelectFontViewController.h | 13 ++ Fonty-Demo/FYSelectFontViewController.m | 133 +++++++++++++ .../UserInterfaceState.xcuserstate | Bin 8334 -> 0 bytes Fonty-Demo/Fonty-Demo/ViewController.m | 27 --- Fonty-Demo/Fonty/FYFontCache.h | 22 --- Fonty-Demo/Fonty/FYFontCache.m | 112 ----------- Fonty-Demo/Fonty/FYFontDownloader.h | 20 -- Fonty-Demo/Fonty/FYFontDownloader.m | 80 -------- Fonty-Demo/Fonty/FYFontManager.h | 33 ---- Fonty-Demo/Fonty/FYFontManager.m | 175 ------------------ Fonty-Demo/Fonty/FYFontModel.h | 30 --- Fonty-Demo/Fonty/FYFontModel.m | 24 --- Fonty-Demo/Fonty/FYFontRegister.h | 17 -- Fonty-Demo/Fonty/FYFontRegister.m | 39 ---- Fonty-Demo/Fonty/FYHeader.h | 18 -- Fonty-Demo/Fonty/UIFont+FY_Fonty.h | 17 -- Fonty-Demo/Fonty/UIFont+FY_Fonty.m | 25 --- Fonty-Demo/{Fonty-Demo => }/Info.plist | 5 + Fonty-Demo/{Fonty-Demo => }/ViewController.h | 0 Fonty-Demo/ViewController.m | 54 ++++++ Fonty-Demo/{Fonty-Demo => }/main.m | 0 Fonty/FYFontManager.h | 2 - Fonty/FYFontManager.m | 15 +- Fonty/FYFontModel.m | 9 + 38 files changed, 315 insertions(+), 684 deletions(-) rename {Fonty-Demo/Fonty-Demo.xcodeproj => Fonty-Demo.xcodeproj}/project.pbxproj (75%) rename {Fonty-Demo/Fonty-Demo.xcodeproj => Fonty-Demo.xcodeproj}/project.xcworkspace/contents.xcworkspacedata (100%) create mode 100644 Fonty-Demo.xcodeproj/project.xcworkspace/xcuserdata/yanweichen.xcuserdatad/UserInterfaceState.xcuserstate create mode 100644 Fonty-Demo.xcodeproj/xcuserdata/yanweichen.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist rename {Fonty-Demo/Fonty-Demo.xcodeproj => Fonty-Demo.xcodeproj}/xcuserdata/yanweichen.xcuserdatad/xcschemes/Fonty-Demo.xcscheme (100%) rename {Fonty-Demo/Fonty-Demo.xcodeproj => Fonty-Demo.xcodeproj}/xcuserdata/yanweichen.xcuserdatad/xcschemes/xcschememanagement.plist (100%) rename Fonty-Demo/{Fonty-Demo => }/AppDelegate.h (100%) rename Fonty-Demo/{Fonty-Demo => }/AppDelegate.m (100%) rename Fonty-Demo/{Fonty-Demo => }/Assets.xcassets/AppIcon.appiconset/Contents.json (100%) rename Fonty-Demo/{Fonty-Demo => }/Base.lproj/LaunchScreen.storyboard (100%) rename Fonty-Demo/{Fonty-Demo => }/Base.lproj/Main.storyboard (100%) create mode 100644 Fonty-Demo/FYSelectFontTableViewCell.h create mode 100644 Fonty-Demo/FYSelectFontTableViewCell.m create mode 100644 Fonty-Demo/FYSelectFontViewController.h create mode 100644 Fonty-Demo/FYSelectFontViewController.m delete mode 100644 Fonty-Demo/Fonty-Demo.xcodeproj/project.xcworkspace/xcuserdata/yanweichen.xcuserdatad/UserInterfaceState.xcuserstate delete mode 100644 Fonty-Demo/Fonty-Demo/ViewController.m delete mode 100644 Fonty-Demo/Fonty/FYFontCache.h delete mode 100644 Fonty-Demo/Fonty/FYFontCache.m delete mode 100644 Fonty-Demo/Fonty/FYFontDownloader.h delete mode 100644 Fonty-Demo/Fonty/FYFontDownloader.m delete mode 100644 Fonty-Demo/Fonty/FYFontManager.h delete mode 100644 Fonty-Demo/Fonty/FYFontManager.m delete mode 100644 Fonty-Demo/Fonty/FYFontModel.h delete mode 100644 Fonty-Demo/Fonty/FYFontModel.m delete mode 100644 Fonty-Demo/Fonty/FYFontRegister.h delete mode 100644 Fonty-Demo/Fonty/FYFontRegister.m delete mode 100644 Fonty-Demo/Fonty/FYHeader.h delete mode 100644 Fonty-Demo/Fonty/UIFont+FY_Fonty.h delete mode 100644 Fonty-Demo/Fonty/UIFont+FY_Fonty.m rename Fonty-Demo/{Fonty-Demo => }/Info.plist (93%) rename Fonty-Demo/{Fonty-Demo => }/ViewController.h (100%) create mode 100644 Fonty-Demo/ViewController.m rename Fonty-Demo/{Fonty-Demo => }/main.m (100%) diff --git a/.DS_Store b/.DS_Store index e3fdcde695c86a43b6e1b8b2a29a64142ad5357d..aa1bb1850ad26b54c538867643c6faa9a2d86389 100644 GIT binary patch delta 306 zcmZoMXfc=|#>B!ku~2NHo+2aL#(>?7izhHMF|uvuVG3fb7h!N?$Y;o7C}F5%&}DF8 zNM*3XosGPy}RU<)j-1C+FuDFo40)NkEEdy}9`=E-9rY$qWpa|Ja@b z8vxatOW5Mv{1hCT3F|G$Kyoyrz~)Bgy^NdLIruq%Ap+!lXP(S2;>f|sz`z7@)aD40 GHOv4XqC>U- delta 101 zcmZoMXfc=|#>B)qu~2NHo+2aj#(>?7jLe&PSb`W8xft9S@)`0NN*F2`bQxS2QWsY@^bR?(is>S7&i-Yh_Os;DB8@"; }; 6A73D6BE1D86BB2600D38630 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 6A73D6C01D86BB2600D38630 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 6A73D6C71D86BB6500D38630 /* FYFontCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FYFontCache.h; sourceTree = ""; }; - 6A73D6C81D86BB6500D38630 /* FYFontCache.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FYFontCache.m; sourceTree = ""; }; - 6A73D6C91D86BB6500D38630 /* FYFontDownloader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FYFontDownloader.h; sourceTree = ""; }; - 6A73D6CA1D86BB6500D38630 /* FYFontDownloader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FYFontDownloader.m; sourceTree = ""; }; - 6A73D6CB1D86BB6500D38630 /* FYFontManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FYFontManager.h; sourceTree = ""; }; - 6A73D6CC1D86BB6500D38630 /* FYFontManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FYFontManager.m; sourceTree = ""; }; - 6A73D6CD1D86BB6500D38630 /* FYFontModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FYFontModel.h; sourceTree = ""; }; - 6A73D6CE1D86BB6500D38630 /* FYFontModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FYFontModel.m; sourceTree = ""; }; - 6A73D6CF1D86BB6500D38630 /* FYFontRegister.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FYFontRegister.h; sourceTree = ""; }; - 6A73D6D01D86BB6500D38630 /* FYFontRegister.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FYFontRegister.m; sourceTree = ""; }; - 6A73D6D11D86BB6500D38630 /* FYHeader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FYHeader.h; sourceTree = ""; }; - 6A73D6D21D86BB6500D38630 /* UIFont+FY_Fonty.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIFont+FY_Fonty.h"; sourceTree = ""; }; - 6A73D6D31D86BB6500D38630 /* UIFont+FY_Fonty.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIFont+FY_Fonty.m"; sourceTree = ""; }; + 6A73D6DB1D86C05000D38630 /* FYFontCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FYFontCache.h; sourceTree = ""; }; + 6A73D6DC1D86C05000D38630 /* FYFontCache.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FYFontCache.m; sourceTree = ""; }; + 6A73D6DD1D86C05000D38630 /* FYFontDownloader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FYFontDownloader.h; sourceTree = ""; }; + 6A73D6DE1D86C05000D38630 /* FYFontDownloader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FYFontDownloader.m; sourceTree = ""; }; + 6A73D6DF1D86C05000D38630 /* FYFontManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FYFontManager.h; sourceTree = ""; }; + 6A73D6E01D86C05000D38630 /* FYFontManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FYFontManager.m; sourceTree = ""; }; + 6A73D6E11D86C05000D38630 /* FYFontModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FYFontModel.h; sourceTree = ""; }; + 6A73D6E21D86C05000D38630 /* FYFontModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FYFontModel.m; sourceTree = ""; }; + 6A73D6E31D86C05000D38630 /* FYFontRegister.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FYFontRegister.h; sourceTree = ""; }; + 6A73D6E41D86C05000D38630 /* FYFontRegister.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FYFontRegister.m; sourceTree = ""; }; + 6A73D6E51D86C05000D38630 /* FYHeader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FYHeader.h; sourceTree = ""; }; + 6A73D6E61D86C05000D38630 /* UIFont+FY_Fonty.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIFont+FY_Fonty.h"; sourceTree = ""; }; + 6A73D6E71D86C05000D38630 /* UIFont+FY_Fonty.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIFont+FY_Fonty.m"; sourceTree = ""; }; + 6A73D6EE1D86C09500D38630 /* FYSelectFontViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FYSelectFontViewController.h; sourceTree = ""; }; + 6A73D6EF1D86C09500D38630 /* FYSelectFontViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FYSelectFontViewController.m; sourceTree = ""; }; + 6A73D6F01D86C09500D38630 /* FYSelectFontTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FYSelectFontTableViewCell.h; sourceTree = ""; }; + 6A73D6F11D86C09500D38630 /* FYSelectFontTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FYSelectFontTableViewCell.m; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -62,7 +68,7 @@ isa = PBXGroup; children = ( 6A73D6AE1D86BB2600D38630 /* Fonty-Demo */, - 6A73D6C61D86BB6500D38630 /* Fonty */, + 6A73D6DA1D86C05000D38630 /* Fonty */, 6A73D6AD1D86BB2600D38630 /* Products */, ); sourceTree = ""; @@ -82,6 +88,10 @@ 6A73D6B31D86BB2600D38630 /* AppDelegate.m */, 6A73D6B51D86BB2600D38630 /* ViewController.h */, 6A73D6B61D86BB2600D38630 /* ViewController.m */, + 6A73D6EE1D86C09500D38630 /* FYSelectFontViewController.h */, + 6A73D6EF1D86C09500D38630 /* FYSelectFontViewController.m */, + 6A73D6F01D86C09500D38630 /* FYSelectFontTableViewCell.h */, + 6A73D6F11D86C09500D38630 /* FYSelectFontTableViewCell.m */, 6A73D6B81D86BB2600D38630 /* Main.storyboard */, 6A73D6BB1D86BB2600D38630 /* Assets.xcassets */, 6A73D6BD1D86BB2600D38630 /* LaunchScreen.storyboard */, @@ -99,22 +109,22 @@ name = "Supporting Files"; sourceTree = ""; }; - 6A73D6C61D86BB6500D38630 /* Fonty */ = { + 6A73D6DA1D86C05000D38630 /* Fonty */ = { isa = PBXGroup; children = ( - 6A73D6C71D86BB6500D38630 /* FYFontCache.h */, - 6A73D6C81D86BB6500D38630 /* FYFontCache.m */, - 6A73D6C91D86BB6500D38630 /* FYFontDownloader.h */, - 6A73D6CA1D86BB6500D38630 /* FYFontDownloader.m */, - 6A73D6CB1D86BB6500D38630 /* FYFontManager.h */, - 6A73D6CC1D86BB6500D38630 /* FYFontManager.m */, - 6A73D6CD1D86BB6500D38630 /* FYFontModel.h */, - 6A73D6CE1D86BB6500D38630 /* FYFontModel.m */, - 6A73D6CF1D86BB6500D38630 /* FYFontRegister.h */, - 6A73D6D01D86BB6500D38630 /* FYFontRegister.m */, - 6A73D6D11D86BB6500D38630 /* FYHeader.h */, - 6A73D6D21D86BB6500D38630 /* UIFont+FY_Fonty.h */, - 6A73D6D31D86BB6500D38630 /* UIFont+FY_Fonty.m */, + 6A73D6DB1D86C05000D38630 /* FYFontCache.h */, + 6A73D6DC1D86C05000D38630 /* FYFontCache.m */, + 6A73D6DD1D86C05000D38630 /* FYFontDownloader.h */, + 6A73D6DE1D86C05000D38630 /* FYFontDownloader.m */, + 6A73D6DF1D86C05000D38630 /* FYFontManager.h */, + 6A73D6E01D86C05000D38630 /* FYFontManager.m */, + 6A73D6E11D86C05000D38630 /* FYFontModel.h */, + 6A73D6E21D86C05000D38630 /* FYFontModel.m */, + 6A73D6E31D86C05000D38630 /* FYFontRegister.h */, + 6A73D6E41D86C05000D38630 /* FYFontRegister.m */, + 6A73D6E51D86C05000D38630 /* FYHeader.h */, + 6A73D6E61D86C05000D38630 /* UIFont+FY_Fonty.h */, + 6A73D6E71D86C05000D38630 /* UIFont+FY_Fonty.m */, ); path = Fonty; sourceTree = ""; @@ -189,15 +199,17 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 6A73D6F21D86C09500D38630 /* FYSelectFontViewController.m in Sources */, 6A73D6B71D86BB2600D38630 /* ViewController.m in Sources */, 6A73D6B41D86BB2600D38630 /* AppDelegate.m in Sources */, - 6A73D6D41D86BB6500D38630 /* FYFontCache.m in Sources */, - 6A73D6D61D86BB6500D38630 /* FYFontManager.m in Sources */, - 6A73D6D51D86BB6500D38630 /* FYFontDownloader.m in Sources */, + 6A73D6E81D86C05000D38630 /* FYFontCache.m in Sources */, + 6A73D6EA1D86C05000D38630 /* FYFontManager.m in Sources */, + 6A73D6F31D86C09500D38630 /* FYSelectFontTableViewCell.m in Sources */, + 6A73D6E91D86C05000D38630 /* FYFontDownloader.m in Sources */, 6A73D6B11D86BB2600D38630 /* main.m in Sources */, - 6A73D6D81D86BB6500D38630 /* FYFontRegister.m in Sources */, - 6A73D6D91D86BB6500D38630 /* UIFont+FY_Fonty.m in Sources */, - 6A73D6D71D86BB6500D38630 /* FYFontModel.m in Sources */, + 6A73D6EC1D86C05000D38630 /* FYFontRegister.m in Sources */, + 6A73D6ED1D86C05000D38630 /* UIFont+FY_Fonty.m in Sources */, + 6A73D6EB1D86C05000D38630 /* FYFontModel.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -312,6 +324,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; INFOPLIST_FILE = "Fonty-Demo/Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "s2mh.Fonty-Demo"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -323,6 +336,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; INFOPLIST_FILE = "Fonty-Demo/Info.plist"; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "s2mh.Fonty-Demo"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -348,6 +362,7 @@ 6A73D6C51D86BB2600D38630 /* Release */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; diff --git a/Fonty-Demo/Fonty-Demo.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Fonty-Demo.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 100% rename from Fonty-Demo/Fonty-Demo.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to Fonty-Demo.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/Fonty-Demo.xcodeproj/project.xcworkspace/xcuserdata/yanweichen.xcuserdatad/UserInterfaceState.xcuserstate b/Fonty-Demo.xcodeproj/project.xcworkspace/xcuserdata/yanweichen.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000000000000000000000000000000000000..41d9ec21b95f69f251f500c4cc62b16294e6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S;RU&d;QK7UF6iu`->SLZ*Fzb=1c z{+9f0`A_A)l7BA$w*peY6z~O(1D=aQFLX>J% z;l#qa!urC-LUZA~!Ucs33l|sOSa@^cvclU7?<`zdcyHnTg=-2QEZkAJv+&VzGsj&w zP8hdv+~V;WJ)L3LL+EKKp z=;@+oiw+dq7kd|vD)uWLU2HDyD()_xRoq+rM)8Nm9~Yl2K3x(~l2DRVl2VdZa#At7HG&&nyjBZ9h z<7i`$F~k^Vj4;L;#~KaBa$~J=lCj>{U~Do%UQc6}vD-M?*lS#9yxDlCvCp{G_@Hrz zai{SS;~wKP#{I_UjE9Vejc*v=Gk$73XZ+dttMNDEA7!}AuFSDaS>{^iQRY>qDvK!7 zmZg>Dl@*kYD=R81DXT84DVtPQU)EUGT-H|BTehfddD*J6)n)gWttsm(+gi50Y-iac zWsjFVS+=k2)w1Jdr^>!9`@ZalvLDNSD*L6JDd)@W%N@&=rFS9mYVJ`-DlcpderoU=_%7*)3c`irq@jGnLaoD zWctLe-M0N2>Nz9jJP>>bQXgR%~d;AkE#x=4yg{Sj;z*I>#Gy1Q>s&|4b=tJrs^rx)2gqjZmaIBo?U%y z_55m~dSUg=)pt~{u3lHe*Vxy%*96r>)M#tcYR1(R*BEO|HB~heYwBuRYFcaBYi8DT z*UYM!Q*&+2nwsZp&enR@2G&N@#@5Eyrq>#3$JI`%t*@P4JEOL(wxf1V?X9)TYgg3X zUAwCGzS=dl{k0ovH`i{f-Cn!9c5m%7wfpOQ>O$+n>muvabu;U(s}t%L)-A4kx$d31 i_v%j6eN^{d-H&ybWRMpU8(aTT4CE)0e<4)&`~L^%Cbj?o literal 0 HcmV?d00001 diff --git a/Fonty-Demo.xcodeproj/xcuserdata/yanweichen.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/Fonty-Demo.xcodeproj/xcuserdata/yanweichen.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 0000000..fe2b454 --- /dev/null +++ b/Fonty-Demo.xcodeproj/xcuserdata/yanweichen.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,5 @@ + + + diff --git a/Fonty-Demo/Fonty-Demo.xcodeproj/xcuserdata/yanweichen.xcuserdatad/xcschemes/Fonty-Demo.xcscheme b/Fonty-Demo.xcodeproj/xcuserdata/yanweichen.xcuserdatad/xcschemes/Fonty-Demo.xcscheme similarity index 100% rename from Fonty-Demo/Fonty-Demo.xcodeproj/xcuserdata/yanweichen.xcuserdatad/xcschemes/Fonty-Demo.xcscheme rename to Fonty-Demo.xcodeproj/xcuserdata/yanweichen.xcuserdatad/xcschemes/Fonty-Demo.xcscheme diff --git a/Fonty-Demo/Fonty-Demo.xcodeproj/xcuserdata/yanweichen.xcuserdatad/xcschemes/xcschememanagement.plist b/Fonty-Demo.xcodeproj/xcuserdata/yanweichen.xcuserdatad/xcschemes/xcschememanagement.plist similarity index 100% rename from Fonty-Demo/Fonty-Demo.xcodeproj/xcuserdata/yanweichen.xcuserdatad/xcschemes/xcschememanagement.plist rename to Fonty-Demo.xcodeproj/xcuserdata/yanweichen.xcuserdatad/xcschemes/xcschememanagement.plist diff --git a/Fonty-Demo/Fonty-Demo/AppDelegate.h b/Fonty-Demo/AppDelegate.h similarity index 100% rename from Fonty-Demo/Fonty-Demo/AppDelegate.h rename to Fonty-Demo/AppDelegate.h diff --git a/Fonty-Demo/Fonty-Demo/AppDelegate.m b/Fonty-Demo/AppDelegate.m similarity index 100% rename from Fonty-Demo/Fonty-Demo/AppDelegate.m rename to Fonty-Demo/AppDelegate.m diff --git a/Fonty-Demo/Fonty-Demo/Assets.xcassets/AppIcon.appiconset/Contents.json b/Fonty-Demo/Assets.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from Fonty-Demo/Fonty-Demo/Assets.xcassets/AppIcon.appiconset/Contents.json rename to Fonty-Demo/Assets.xcassets/AppIcon.appiconset/Contents.json diff --git a/Fonty-Demo/Fonty-Demo/Base.lproj/LaunchScreen.storyboard b/Fonty-Demo/Base.lproj/LaunchScreen.storyboard similarity index 100% rename from Fonty-Demo/Fonty-Demo/Base.lproj/LaunchScreen.storyboard rename to Fonty-Demo/Base.lproj/LaunchScreen.storyboard diff --git a/Fonty-Demo/Fonty-Demo/Base.lproj/Main.storyboard b/Fonty-Demo/Base.lproj/Main.storyboard similarity index 100% rename from Fonty-Demo/Fonty-Demo/Base.lproj/Main.storyboard rename to Fonty-Demo/Base.lproj/Main.storyboard diff --git a/Fonty-Demo/FYSelectFontTableViewCell.h b/Fonty-Demo/FYSelectFontTableViewCell.h new file mode 100644 index 0000000..7025270 --- /dev/null +++ b/Fonty-Demo/FYSelectFontTableViewCell.h @@ -0,0 +1,13 @@ +// +// FYSelectFontTableViewCell.h +// Fonty +// +// Created by 颜为晨 on 9/9/16. +// Copyright © 2016 颜为晨. All rights reserved. +// + +#import + +@interface FYSelectFontTableViewCell : UITableViewCell + +@end diff --git a/Fonty-Demo/FYSelectFontTableViewCell.m b/Fonty-Demo/FYSelectFontTableViewCell.m new file mode 100644 index 0000000..a98dc77 --- /dev/null +++ b/Fonty-Demo/FYSelectFontTableViewCell.m @@ -0,0 +1,16 @@ + +// +// FYSelectFontTableViewCell.m +// Fonty +// +// Created by 颜为晨 on 9/9/16. +// Copyright © 2016 颜为晨. All rights reserved. +// + +#import "FYSelectFontTableViewCell.h" + +@implementation FYSelectFontTableViewCell + +//- () + +@end diff --git a/Fonty-Demo/FYSelectFontViewController.h b/Fonty-Demo/FYSelectFontViewController.h new file mode 100644 index 0000000..df3e1c9 --- /dev/null +++ b/Fonty-Demo/FYSelectFontViewController.h @@ -0,0 +1,13 @@ +// +// FYSelectFontViewController.h +// Fonty +// +// Created by 颜为晨 on 9/9/16. +// Copyright © 2016 颜为晨. All rights reserved. +// + +#import + +@interface FYSelectFontViewController : UITableViewController + +@end diff --git a/Fonty-Demo/FYSelectFontViewController.m b/Fonty-Demo/FYSelectFontViewController.m new file mode 100644 index 0000000..c14081d --- /dev/null +++ b/Fonty-Demo/FYSelectFontViewController.m @@ -0,0 +1,133 @@ +// +// FYSelectFontViewController.m +// Fonty +// +// Created by 颜为晨 on 9/9/16. +// Copyright © 2016 颜为晨. All rights reserved. +// + +#import "FYSelectFontViewController.h" +#import "FYHeader.h" + +static NSString *const UITableViewCellIdentifier = @"UITableViewCellIdentifier"; + +@interface FYSelectFontViewController () + +@property (nonatomic, weak) FYFontManager *fontManager; +@property (nonatomic, weak) NSArray *fontModelArray; + +@end + +@implementation FYSelectFontViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + self.navigationItem.title = @"Fonty"; + + self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Done" + style:UIBarButtonItemStyleDone + target:self + action:@selector(backAction)]; + + self.fontManager = [FYFontManager sharedManager]; + self.fontModelArray = self.fontManager.fontModelArray; + + [self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:UITableViewCellIdentifier]; +} + +#pragma mark - UITableViewDataSource + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { + return self.fontModelArray.count; +} + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { + FYFontModel *model = [self.fontModelArray objectAtIndex:indexPath.row]; + UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:UITableViewCellIdentifier forIndexPath:indexPath]; + + cell.selectionStyle = UITableViewCellSelectionStyleBlue; + cell.textLabel.text = model.description; + cell.accessoryView = nil; + + if (model.status == FYFontModelDownloadStatusDownloaded) { + if (indexPath.row == self.fontManager.mainFontIndex) { + cell.selected = YES; + } + } else if (model.status == FYFontModelDownloadStatusDeleting || model.status == FYFontModelDownloadStatusDownloading) { + UIActivityIndicatorView *AIV = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite]; + [AIV startAnimating]; + cell.accessoryView = AIV; + } + + return cell; +} + +- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath { + FYFontModel *model = [self.fontModelArray objectAtIndex:indexPath.row]; + return model.status == FYFontModelDownloadStatusDownloaded; +} + +- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { + if (editingStyle == UITableViewCellEditingStyleDelete) { + + FYFontModel *model = [self.fontModelArray objectAtIndex:indexPath.row]; + model.status = FYFontModelDownloadStatusDeleting; + [tableView reloadData]; + + [self.fontManager deleteFontWithURL:model.URL completeBlock:^{ + model.status = FYFontModelDownloadStatusToBeDownloaded; + self.fontManager.mainFontIndex = 0; + [tableView reloadData]; + }]; + } +} + +#pragma mark UITableViewDelegate + +- (NSIndexPath *)tableView:(UITableView *)tableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath { + FYFontModel *model = [self.fontModelArray objectAtIndex:indexPath.row]; + if (model.status == FYFontModelDownloadStatusDownloaded) { + self.fontManager.mainFontIndex = indexPath.row; + [tableView reloadData]; + return indexPath; + } else { + UIAlertView *AV = [[UIAlertView alloc] initWithTitle:@"Download Font File from" + message:model.URL.absoluteString + delegate:self + cancelButtonTitle:@"cancel" + otherButtonTitles:@"start", nil]; + AV.tag = indexPath.row; + [AV show]; + return nil; + } +} + +- (NSString *)tableView:(UITableView *)tableView titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath { + return @"clear"; +} + +- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath { + FYFontModel *model = [self.fontModelArray objectAtIndex:indexPath.row]; + if (model.status == FYFontModelDownloadStatusDownloaded || model.URL) { + return UITableViewCellEditingStyleDelete; + } else { + return UITableViewCellEditingStyleNone; + } +} + +#pragma mark UIAlertViewDelegate + +- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex { + if (buttonIndex == 1) { + FYFontModel *model = [self.fontModelArray objectAtIndex:alertView.tag]; + [self.fontManager downloadFontWithURL:model.URL]; + } +} + +#pragma mark - Action + +- (void)backAction { + [self dismissViewControllerAnimated:YES completion:nil]; +} + +@end diff --git a/Fonty-Demo/Fonty-Demo.xcodeproj/project.xcworkspace/xcuserdata/yanweichen.xcuserdatad/UserInterfaceState.xcuserstate b/Fonty-Demo/Fonty-Demo.xcodeproj/project.xcworkspace/xcuserdata/yanweichen.xcuserdatad/UserInterfaceState.xcuserstate deleted file mode 100644 index a1bcaa23fe38ca7bf4b12b8200262ae585a1f3e0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8334 zcmb_hcYIXU@}F}yyL-2nyEUQ)iJ_QYNCF6?(nBC5B%!REW1~DK91^tTtyE1-;5D0qwzRGxi%`~Al6s(GO2WqE!*zIxgA%CM8$f7md zjPHUHIN-qoR_F=6pf~h^n;;RAAQ|$Z01BZ9ieU&0g<&upM!-lI1!XV}s=y63Pz!Y+ zz;p;g2xh??xE&V49q=$b0*}IDupAzT70?2$un9K9lduK0!%o-*FTz219ge^mI13-b zNAMY3gx?7eLMV}u7$PSMq9h#A69cgl8;K*`$ql3j=}B@)KhmEJAUBhNWDprl^2jJs zLPnEPGKP#N6G&TO23)x1V zAQtFUVKqJMumGf&4~gR717Y zLao$Eucz@ektWe(+Lvb296Fc|r=@fpt)x}7nog#*w4P31*^IdW0UO|D+$&Pv`~uDgBIIq?hRD^fLW| zeo6mT9`6f#y(d8hYS4fd3}7B#QkFbjXbM)d&$i{Rh_Cg!gTYqNfgUN!TEPe=jKLik z=Q75prDbKMrRJw6WfbRTBxPo?tK6)j{G_~${G9yUtjzSH^mLceGOVy@ygx8K*yyem z3jMX=2EiAK8n(f8kgyT#-~cDY!Zpwhu0=U2P>CF>P>q_6a6QC9cjkc|;vpWjxE-Hm zzR1zWUhyvDz|Q)|xoZmizEHsL^$G!3Q9)60UV2VJQeIYWZc=97)YPQhwA6y6;G?&e>DgJClf}n9zB>QR;()tBa2dO^8>0htLO`f%ce{()pv#!p*{1Y#huLzU=hm<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PM|Dzz%DMyu22XzR6)X!mR1)*jU!*Phaz(Vo-(U3)?Mnf8+Qvi3*qZ#vLX zol>XLX>>YWny#O2h;F2=L|3XS*NxXz=_csvbWOSix;u1t>h9J(u3M*jTDM2{qV6T# z0o_48ukWVstxwjc>eKbv`doc~{muG9{RsUn`sweLJIt--SIr-oKQ(`5zGVL1{FC_?^Y1+2WxSnt@(Fxz{w6+|Pvz73 z{`_D*pD*N#`7*weujVK6ZoZZm_93;9L-V*WmU3I8DfIKPqK#Bb)e@VoiF z{678we~^ELe}_N8pW@H(=lDsP z_Jj6U?8ogV?WgT$9lab`j)9KBj(kUAc+RoQvDdNBvET8s@9G^SBaQw^htCMqDoe9of&OXjW zXR~OUA7k~gqhl*# cC&kvsHpR}1T^QLa0Htl8-%6j+_t-`M2Rx%r^Z)<= diff --git a/Fonty-Demo/Fonty-Demo/ViewController.m b/Fonty-Demo/Fonty-Demo/ViewController.m deleted file mode 100644 index d1bd091..0000000 --- a/Fonty-Demo/Fonty-Demo/ViewController.m +++ /dev/null @@ -1,27 +0,0 @@ -// -// ViewController.m -// Fonty-Demo -// -// Created by 颜为晨 on 9/12/16. -// Copyright © 2016 s2mh. All rights reserved. -// - -#import "ViewController.h" - -@interface ViewController () - -@end - -@implementation ViewController - -- (void)viewDidLoad { - [super viewDidLoad]; - // Do any additional setup after loading the view, typically from a nib. -} - -- (void)didReceiveMemoryWarning { - [super didReceiveMemoryWarning]; - // Dispose of any resources that can be recreated. -} - -@end diff --git a/Fonty-Demo/Fonty/FYFontCache.h b/Fonty-Demo/Fonty/FYFontCache.h deleted file mode 100644 index 5925c86..0000000 --- a/Fonty-Demo/Fonty/FYFontCache.h +++ /dev/null @@ -1,22 +0,0 @@ -// -// FYFontCache.h -// Fonty -// -// Created by 颜为晨 on 16/7/2. -// Copyright © 2016年 颜为晨. All rights reserved. -// - -#import -#import - -@interface FYFontCache : NSObject - -@property (nonatomic, copy, readonly) NSString *diskCacheDirectoryPath; - -+ (instancetype)sharedFontCache; - -- (NSString *)cachedFilePathWithWebURL:(NSURL *)webURL; -- (NSString *)cacheFileAtLocolURL:(NSURL *)locolURL fromWebURL:(NSURL *)webURL; -- (void)cleanCachedFileWithWebURL:(NSURL *)webURL; - -@end diff --git a/Fonty-Demo/Fonty/FYFontCache.m b/Fonty-Demo/Fonty/FYFontCache.m deleted file mode 100644 index b8c31b0..0000000 --- a/Fonty-Demo/Fonty/FYFontCache.m +++ /dev/null @@ -1,112 +0,0 @@ -// -// FYFontCache.m -// Fonty -// -// Created by 颜为晨 on 16/7/2. -// Copyright © 2016年 颜为晨. All rights reserved. -// - -#import -#import "FYFontCache.h" - -static NSString * const FTFontCacheDirectoryName = @"FTFont"; - -@interface FYFontCache () - -@property (nonatomic, copy, readwrite) NSString *diskCacheDirectoryPath; -@property (nonatomic, strong) NSMutableDictionary *cachePaths; // key = URLString, object = fontFileName -@property (nonatomic, weak) NSFileManager *fileManager; - -@end - -@implementation FYFontCache - -+ (instancetype)sharedFontCache { - static id instance; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - instance = [self new]; - }); - return instance; -} - -- (instancetype)init -{ - self = [super init]; - if (self) { - _fileManager = [NSFileManager defaultManager]; - } - return self; -} - -#pragma mark - Public - -- (NSString *)cachedFilePathWithWebURL:(NSURL *)webURL { - NSString *filePath = [self cachedFilePathForWebURLString:webURL.absoluteString]; - if ([self.fileManager fileExistsAtPath:filePath]) { - return filePath; - } else { - return nil; - } -} - -- (NSString *)cacheFileAtLocolURL:(NSURL *)locolURL fromWebURL:(NSURL *)webURL { - NSString *filePath = [self cachedFilePathForWebURLString:webURL.absoluteString]; - if (![self.fileManager fileExistsAtPath:filePath]) { - [self.fileManager removeItemAtPath:filePath error:NULL]; - } - NSURL *docsDirURL = [NSURL fileURLWithPath:filePath]; - [self.fileManager moveItemAtURL:locolURL - toURL:docsDirURL - error:NULL]; - return filePath; -} - -- (void)cleanCachedFileWithWebURL:(NSURL *)webURL { - NSString *filePath = [self cachedFilePathForWebURLString:webURL.absoluteString]; - [[NSFileManager defaultManager] removeItemAtPath:filePath error:nil]; -} - -#pragma mark - Private - -- (NSString *)cachedFilePathForWebURLString:(NSString *)URLString { - NSString *fontFileName = [self.cachePaths objectForKey:URLString]; - if (!fontFileName) { - const char *str = [URLString UTF8String]; - if (str == NULL) { - return @""; - } - unsigned char r[CC_MD5_DIGEST_LENGTH]; - CC_MD5(str, (CC_LONG)strlen(str), r); - fontFileName = [NSString stringWithFormat:@"%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x", - r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7], r[8], r[9], r[10], - r[11], r[12], r[13], r[14], r[15]]; - [self.cachePaths setObject:fontFileName forKey:URLString]; - } - - return [self.diskCacheDirectoryPath stringByAppendingPathComponent:fontFileName]; -} - - -#pragma mark - accessor - -- (NSString *)diskCacheDirectoryPath { - if (!_diskCacheDirectoryPath) { - NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES); - _diskCacheDirectoryPath = [[paths objectAtIndex:0] stringByAppendingPathComponent:FTFontCacheDirectoryName]; - [self.fileManager createDirectoryAtPath:_diskCacheDirectoryPath - withIntermediateDirectories:YES - attributes:nil - error:nil]; - } - return _diskCacheDirectoryPath; -} - -- (NSMutableDictionary *)cachePaths { - if (!_cachePaths) { - _cachePaths = [NSMutableDictionary dictionary]; - } - return _cachePaths; -} - -@end diff --git a/Fonty-Demo/Fonty/FYFontDownloader.h b/Fonty-Demo/Fonty/FYFontDownloader.h deleted file mode 100644 index 7f8bae4..0000000 --- a/Fonty-Demo/Fonty/FYFontDownloader.h +++ /dev/null @@ -1,20 +0,0 @@ -// -// FYFontDownloader.h -// Fonty -// -// Created by 颜为晨 on 9/9/16. -// Copyright © 2016 颜为晨. All rights reserved. -// - -#import - -extern NSString *const FYNewFontDownloadNotification; -extern NSString *const FYNewFontDownloadNotificationKey; - -@interface FYFontDownloader : NSObject - -+ (instancetype)sharedDownloader; - -- (void)downloadFontWithURL:(NSURL *)URL; - -@end diff --git a/Fonty-Demo/Fonty/FYFontDownloader.m b/Fonty-Demo/Fonty/FYFontDownloader.m deleted file mode 100644 index 391d2a2..0000000 --- a/Fonty-Demo/Fonty/FYFontDownloader.m +++ /dev/null @@ -1,80 +0,0 @@ -// -// FYFontDownloader.m -// Fonty -// -// Created by 颜为晨 on 9/9/16. -// Copyright © 2016 颜为晨. All rights reserved. -// - -#import "FYFontDownloader.h" -#import "FYFontCache.h" -#import "FYFontModel.h" - -NSString *const FYNewFontDownloadNotification = @"FYNewFontDownloadNotification"; -NSString *const FYNewFontDownloadNotificationKey = @"FYNewFontDownloadNotificationKey"; // FYDowloadFontModel - -@interface FYFontDownloader () - -@property (nonatomic, strong) NSURLSession *session; - -@end - -@implementation FYFontDownloader - -+ (instancetype)sharedDownloader { - static id instance; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - instance = [self new]; - }); - return instance; -} - -- (void)downloadFontWithURL:(NSURL *)URL { - NSURLSessionDownloadTask *task = [self.session downloadTaskWithURL:URL]; - [task resume]; -} - -#pragma mark - NSURLSessionDownloadDelegate - -- (void)URLSession:(NSURLSession *)session downloadTask:(NSURLSessionDownloadTask *)downloadTask didFinishDownloadingToURL:(NSURL *)location { - NSString *path = [[FYFontCache sharedFontCache] cacheFileAtLocolURL:location fromWebURL:downloadTask.originalRequest.URL]; - if (path) { - dispatch_async(dispatch_get_main_queue(), ^{ - FYFontModel *model = [FYFontModel modelWithURL:downloadTask.originalRequest.URL - status:FYFontModelDownloadStatusDownloaded - downloadProgress:1.0f]; - NSDictionary *userInfo = @{FYNewFontDownloadNotificationKey:model}; - [[NSNotificationCenter defaultCenter] postNotificationName:FYNewFontDownloadNotification object:self userInfo:userInfo]; - }); - } -} - -- (void)URLSession:(NSURLSession *)session downloadTask:(NSURLSessionDownloadTask *)downloadTask - didWriteData:(int64_t)bytesWritten - totalBytesWritten:(int64_t)totalBytesWritten -totalBytesExpectedToWrite:(int64_t)totalBytesExpectedToWrite { - NSLog(@"%f", ((float)totalBytesWritten / totalBytesExpectedToWrite)); - if (totalBytesExpectedToWrite != NSURLSessionTransferSizeUnknown) { - dispatch_async(dispatch_get_main_queue(), ^{ - FYFontModel *model = [FYFontModel modelWithURL:downloadTask.originalRequest.URL - status:FYFontModelDownloadStatusDownloading - downloadProgress:(float)totalBytesWritten / totalBytesExpectedToWrite]; - NSDictionary *userInfo = @{FYNewFontDownloadNotificationKey:model}; - [[NSNotificationCenter defaultCenter] postNotificationName:FYNewFontDownloadNotification object:self userInfo:userInfo]; - }); - } -} - -#pragma mark - accessor - -- (NSURLSession *)session { - if (!_session) { - _session = [NSURLSession sessionWithConfiguration:[NSURLSessionConfiguration defaultSessionConfiguration] - delegate:self - delegateQueue:nil]; - } - return _session; -} - -@end diff --git a/Fonty-Demo/Fonty/FYFontManager.h b/Fonty-Demo/Fonty/FYFontManager.h deleted file mode 100644 index 2ec37f2..0000000 --- a/Fonty-Demo/Fonty/FYFontManager.h +++ /dev/null @@ -1,33 +0,0 @@ -// -// FYFontManager.h -// Fonty -// -// Created by 颜为晨 on 16/7/2. -// Copyright © 2016年 颜为晨. All rights reserved. -// - -#import -#import - -@class FYFontModel; - -extern const NSInteger FYUsingSystemFontIndex; - -@interface FYFontManager : NSObject - -+ (instancetype)sharedManager; - -- (UIFont *)fontWithURL:(NSURL *)URL size:(CGFloat)size; -- (UIFont *)fontWithURLString:(NSString *)URLString size:(CGFloat)size; - -- (UIFont *)mainFontOfSize:(CGFloat)size; -@property (nonatomic, strong) NSArray *fontURLStringArray; -@property (nonatomic, assign) NSInteger mainFontIndex; -@property (nonatomic, strong, readonly) NSArray *fontModelArray; - -- (void)downloadFontWithURL:(NSURL *)URL; -- (void)downloadFontWithURLString:(NSString *)URLString; -- (void)deleteFontWithURL:(NSURL *)URL completeBlock:(void(^)())completeBlock; -- (void)deleteFontWithURLString:(NSString *)URLString completeBlock:(void(^)())completeBlock; - -@end diff --git a/Fonty-Demo/Fonty/FYFontManager.m b/Fonty-Demo/Fonty/FYFontManager.m deleted file mode 100644 index 1245438..0000000 --- a/Fonty-Demo/Fonty/FYFontManager.m +++ /dev/null @@ -1,175 +0,0 @@ -// -// FYFontManager.m -// Fonty -// -// Created by 颜为晨 on 16/7/2. -// Copyright © 2016年 颜为晨. All rights reserved. -// - -#import "FYFontManager.h" -#import "FYFontCache.h" -#import "FYFontRegister.h" -#import "FYFontDownloader.h" -#import "FYFontModel.h" - -const NSInteger FYUsingSystemFontIndex = NSIntegerMin; - -@interface FYFontManager () - -@property (nonatomic, strong) FYFontCache *fontCache; -@property (nonatomic, strong) FYFontDownloader *fontDownloader; -@property (nonatomic, strong) FYFontRegister *fontRegister; - -@property (nonatomic, strong) NSMutableDictionary *postScriptNames; // key = URL.absoluteString, object = postScriptName - -@property (nonatomic, strong, readwrite) NSArray *fontModelArray; - -@end - -@implementation FYFontManager - -+ (instancetype)sharedManager { - static id instance; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - instance = [self new]; - }); - return instance; -} - -- (instancetype)init -{ - self = [super init]; - if (self) { - _fontCache = [FYFontCache sharedFontCache]; - _fontDownloader = [FYFontDownloader sharedDownloader]; - _fontRegister = [FYFontRegister sharedRegister]; - _mainFontIndex = FYUsingSystemFontIndex; - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(changeModelStatus:) - name:FYNewFontDownloadNotification - object:_fontDownloader]; - } - return self; -} - -#pragma mark - Public - -- (UIFont *)fontWithURL:(NSURL *)URL size:(CGFloat)size { - if (![URL isKindOfClass:NSURL.class]) { - return [UIFont systemFontOfSize:size]; - } - - NSString *postScriptName = [self.postScriptNames objectForKey:URL.absoluteString]; - UIFont *font = [UIFont fontWithName:postScriptName size:size]; - - if (![font.fontName isEqualToString:postScriptName]) { - - if (!postScriptName) { - // searching postScriptName in cache - NSString *cachePath = [self.fontCache cachedFilePathWithWebURL:URL]; - if (cachePath) { - postScriptName = [self.fontRegister registerFontWithPath:cachePath completeBlock:^(NSString *registeredPostScriptName){ - [self.postScriptNames setObject:registeredPostScriptName forKey:URL.absoluteString]; - [self.fontModelArray enumerateObjectsUsingBlock:^(FYFontModel * _Nonnull model, NSUInteger idx, BOOL * _Nonnull stop) { - if ([model.URL isEqual:URL]) { - model.postScriptName = registeredPostScriptName; - } - }]; - }]; - } - } - - if (postScriptName) { - // found postScriptName - font = [UIFont fontWithName:postScriptName size:size]; - } - } - - return font; -} - -- (UIFont *)fontWithURLString:(NSString *)URLString size:(CGFloat)size { - return [self fontWithURL:[NSURL URLWithString:URLString] size:size]; -} - -- (UIFont *)mainFontOfSize:(CGFloat)size { - if (self.mainFontIndex < 0 || self.mainFontIndex > self.fontModelArray.count) { - return [UIFont systemFontOfSize:size]; - } - FYFontModel *model = [self.fontModelArray objectAtIndex:self.mainFontIndex]; - return [self fontWithURL:model.URL size:size]; -} - -- (void)downloadFontWithURL:(NSURL *)URL { - if ([URL isKindOfClass:[NSURL class]]) { - [self.fontDownloader downloadFontWithURL:URL]; - } -} - -- (void)downloadFontWithURLString:(NSString *)URLString { - [self downloadFontWithURL:[NSURL URLWithString:URLString]]; -} - -- (void)deleteFontWithURL:(NSURL *)URL completeBlock:(void(^)())completeBlock { - if ([URL isKindOfClass:[NSURL class]]) { - dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ - [self.fontCache cleanCachedFileWithWebURL:URL]; - dispatch_async(dispatch_get_main_queue(), ^{ - if (completeBlock) { - completeBlock(); - } - }); - }); - } -} - -- (void)deleteFontWithURLString:(NSString *)URLString completeBlock:(void(^)())completeBlock { - [self deleteFontWithURL:[NSURL URLWithString:URLString] completeBlock:completeBlock]; -} - -#pragma mark - Notification - -- (void)changeModelStatus:(NSNotification *)notif { - FYFontModel *downloadedModel = [notif.userInfo objectForKey:FYNewFontDownloadNotificationKey]; - for (FYFontModel *model in self.fontModelArray) { - if ([model.URL isEqual:downloadedModel.URL]) { - model.status = FYFontModelDownloadStatusDownloaded; - break; - } - } -} - -#pragma mark - Accessor - -- (void)setFontURLStringArray:(NSArray *)fontURLStringArray { - _fontURLStringArray = fontURLStringArray; - - NSMutableArray *fontModelArray = [NSMutableArray array]; - [fontURLStringArray enumerateObjectsUsingBlock:^(NSString * _Nonnull URLString, NSUInteger idx, BOOL * _Nonnull stop) { - if ([URLString isKindOfClass:[NSString class]]) { - NSURL *URL = [NSURL URLWithString:URLString]; - if ([URL isKindOfClass:[NSURL class]]) { - FYFontModel *model = [FYFontModel modelWithURL:URL - status:FYFontModelDownloadStatusToBeDownloaded - downloadProgress:0.0f]; - NSString *cachePath = [self.fontCache cachedFilePathWithWebURL:URL]; - if (cachePath) { - model.status = FYFontModelDownloadStatusDownloaded; - } - [fontModelArray addObject:model]; - } - } - }]; - _fontModelArray = [fontModelArray copy]; -} - -- (NSMutableDictionary *)postScriptNames { - if (!_postScriptNames) { - _postScriptNames = [NSMutableDictionary dictionary]; - } - return _postScriptNames; -} - -@end - diff --git a/Fonty-Demo/Fonty/FYFontModel.h b/Fonty-Demo/Fonty/FYFontModel.h deleted file mode 100644 index faa3f66..0000000 --- a/Fonty-Demo/Fonty/FYFontModel.h +++ /dev/null @@ -1,30 +0,0 @@ -// -// FYFontModel.h -// Fonty -// -// Created by 颜为晨 on 9/8/16. -// Copyright © 2016 颜为晨. All rights reserved. -// - -#import - - -typedef NS_ENUM(NSUInteger, FYFontModelDownloadStatus) { - FYFontModelDownloadStatusToBeDownloaded, - FYFontModelDownloadStatusDownloading, - FYFontModelDownloadStatusDownloaded, - FYFontModelDownloadStatusDeleting -}; - -@interface FYFontModel : NSObject - -@property (nonatomic, copy) NSURL *URL; -@property (nonatomic, assign) FYFontModelDownloadStatus status; -@property (nonatomic, assign) float downloadProgress; -@property (nonatomic, copy) NSString *postScriptName; - -+ (instancetype)modelWithURL:(NSURL *)URL - status:(FYFontModelDownloadStatus)status - downloadProgress:(float)downloadProgress; - -@end diff --git a/Fonty-Demo/Fonty/FYFontModel.m b/Fonty-Demo/Fonty/FYFontModel.m deleted file mode 100644 index 2dbcf71..0000000 --- a/Fonty-Demo/Fonty/FYFontModel.m +++ /dev/null @@ -1,24 +0,0 @@ -// -// FYFontModel.m -// Fonty -// -// Created by 颜为晨 on 9/8/16. -// Copyright © 2016 颜为晨. All rights reserved. -// - -#import "FYFontModel.h" - -@implementation FYFontModel - -+ (instancetype)modelWithURL:(NSURL *)URL - status:(FYFontModelDownloadStatus)status - downloadProgress:(float)downloadProgress { - FYFontModel *model = [[FYFontModel alloc] init]; - model.URL = URL; - model.status = status; - model.downloadProgress = downloadProgress; - model.postScriptName = @""; - return model; -} - -@end diff --git a/Fonty-Demo/Fonty/FYFontRegister.h b/Fonty-Demo/Fonty/FYFontRegister.h deleted file mode 100644 index dd10b38..0000000 --- a/Fonty-Demo/Fonty/FYFontRegister.h +++ /dev/null @@ -1,17 +0,0 @@ -// -// FYFontRegister.h -// Fonty -// -// Created by 颜为晨 on 9/9/16. -// Copyright © 2016 颜为晨. All rights reserved. -// - -#import - -@interface FYFontRegister : NSObject - -+ (instancetype)sharedRegister; - -- (NSString *)registerFontWithPath:(NSString *)path completeBlock:(void(^)(NSString *))completeBlock; - -@end diff --git a/Fonty-Demo/Fonty/FYFontRegister.m b/Fonty-Demo/Fonty/FYFontRegister.m deleted file mode 100644 index a7bdc2a..0000000 --- a/Fonty-Demo/Fonty/FYFontRegister.m +++ /dev/null @@ -1,39 +0,0 @@ -// -// FYFontRegister.m -// Fonty -// -// Created by 颜为晨 on 9/9/16. -// Copyright © 2016 颜为晨. All rights reserved. -// - -#import -#import "FYFontRegister.h" - -@implementation FYFontRegister - -+ (instancetype)sharedRegister { - static id instance; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - instance = [self new]; - }); - return instance; -} - -- (NSString *)registerFontWithPath:(NSString *)path completeBlock:(void(^)(NSString *))completeBlock { - NSString *postScriptName = nil; - NSURL *fontUrl = [NSURL fileURLWithPath:path]; - CGDataProviderRef fontDataProvider = CGDataProviderCreateWithURL((__bridge CFURLRef)fontUrl); - CGFontRef fontRef = CGFontCreateWithDataProvider(fontDataProvider); - if (fontRef) { - CTFontManagerRegisterGraphicsFont(fontRef, NULL); - postScriptName = CFBridgingRelease(CGFontCopyPostScriptName(fontRef)); - if (completeBlock) { - completeBlock(postScriptName); - } - } - CGFontRelease(fontRef); - return postScriptName; -} - -@end diff --git a/Fonty-Demo/Fonty/FYHeader.h b/Fonty-Demo/Fonty/FYHeader.h deleted file mode 100644 index a1f146b..0000000 --- a/Fonty-Demo/Fonty/FYHeader.h +++ /dev/null @@ -1,18 +0,0 @@ -// -// FYHeader.h -// Fonty -// -// Created by 颜为晨 on 9/8/16. -// Copyright © 2016 颜为晨. All rights reserved. -// - -#ifndef FYHeader_h -#define FYHeader_h - -#import "FYFontManager.h" -#import "FYFontCache.h" -#import "FYFontDownloader.h" -#import "FYFontRegister.h" -#import "FYFontModel.h" - -#endif /* FYHeader_h */ diff --git a/Fonty-Demo/Fonty/UIFont+FY_Fonty.h b/Fonty-Demo/Fonty/UIFont+FY_Fonty.h deleted file mode 100644 index fb31b3b..0000000 --- a/Fonty-Demo/Fonty/UIFont+FY_Fonty.h +++ /dev/null @@ -1,17 +0,0 @@ -// -// UIFont+FY_Fonty.h -// Fonty -// -// Created by 颜为晨 on 16/7/2. -// Copyright © 2016年 颜为晨. All rights reserved. -// - -#import -#import "FYFontManager.h" - -@interface UIFont (FY_Fonty) -+ (UIFont *)fy_mainFontOfSize:(CGFloat)size; -+ (UIFont *)fy_fontWithURL:(NSURL *)URL size:(CGFloat)size; -+ (UIFont *)fy_fontWithURLString:(NSString *)URLString size:(CGFloat)size; - -@end diff --git a/Fonty-Demo/Fonty/UIFont+FY_Fonty.m b/Fonty-Demo/Fonty/UIFont+FY_Fonty.m deleted file mode 100644 index 15eeb75..0000000 --- a/Fonty-Demo/Fonty/UIFont+FY_Fonty.m +++ /dev/null @@ -1,25 +0,0 @@ -// -// UIFont+FY_Fonty.m -// Fonty -// -// Created by 颜为晨 on 16/7/2. -// Copyright © 2016年 颜为晨. All rights reserved. -// - -#import "UIFont+FY_Fonty.h" - -@implementation UIFont (FY_Fonty) - -+ (UIFont *)fy_mainFontOfSize:(CGFloat)size { - return [[FYFontManager sharedManager] mainFontOfSize:size]; -} - -+ (UIFont *)fy_fontWithURL:(NSURL *)URL size:(CGFloat)size { - return [[FYFontManager sharedManager] fontWithURL:URL size:size]; -} - -+ (UIFont *)fy_fontWithURLString:(NSString *)URLString size:(CGFloat)size { - return [[FYFontManager sharedManager] fontWithURLString:URLString size:size]; -} - -@end diff --git a/Fonty-Demo/Fonty-Demo/Info.plist b/Fonty-Demo/Info.plist similarity index 93% rename from Fonty-Demo/Fonty-Demo/Info.plist rename to Fonty-Demo/Info.plist index 40c6215..e09b2be 100644 --- a/Fonty-Demo/Fonty-Demo/Info.plist +++ b/Fonty-Demo/Info.plist @@ -2,6 +2,11 @@ + NSAppTransportSecurity + + NSAllowsArbitraryLoads + + CFBundleDevelopmentRegion en CFBundleExecutable diff --git a/Fonty-Demo/Fonty-Demo/ViewController.h b/Fonty-Demo/ViewController.h similarity index 100% rename from Fonty-Demo/Fonty-Demo/ViewController.h rename to Fonty-Demo/ViewController.h diff --git a/Fonty-Demo/ViewController.m b/Fonty-Demo/ViewController.m new file mode 100644 index 0000000..fad8ff7 --- /dev/null +++ b/Fonty-Demo/ViewController.m @@ -0,0 +1,54 @@ +// +// ViewController.m +// Fonty-Demo +// +// Created by 颜为晨 on 9/12/16. +// Copyright © 2016 s2mh. All rights reserved. +// + +#import "ViewController.h" +#import "FYSelectFontViewController.h" +#import "FYHeader.h" +#import "UIFont+FY_Fonty.h" + +@interface ViewController () + +@property (nonatomic, weak) UILabel *label; +@property (nonatomic, strong) UIProgressView *progressView; + +@end + +@implementation ViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + + [[FYFontManager sharedManager] setFontURLStringArray:@[@"http://115.28.28.235:8080/xx.ttf", + @"http://www.zhaozi.cn/e/enews/?enews=DownSoft&classid=297&id=22785&pathid=0&pass=6a9c20be7abab75c8128ada2c271b041&p=:::"]]; + + UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(10.0f, 50.0f, 300.0f, 50.0f)]; + label.text = @"汉字"; + [self.view addSubview:label]; + self.label = label; + + UIButton *button1 = [UIButton buttonWithType:UIButtonTypeSystem]; + button1.tag = 1; + button1.frame = CGRectMake(10.0f, 100.0f, 300.0f, 20.0f); + [button1 setTitle:@"Fonty" forState:UIControlStateNormal]; + [button1 addTarget:self action:@selector(buttonAction:) forControlEvents:UIControlEventTouchUpInside]; + [self.view addSubview:button1]; +} + +- (void)viewWillAppear:(BOOL)animated { + [super viewWillAppear:animated]; + + [self.label setFont:[UIFont fy_mainFontOfSize:20.0f]]; +} + +- (void)buttonAction:(UIButton *)sender { + FYSelectFontViewController *vc = [[FYSelectFontViewController alloc] init]; + UINavigationController *nc = [[UINavigationController alloc] initWithRootViewController:vc]; + [self presentViewController:nc animated:YES completion:nil]; +} + +@end diff --git a/Fonty-Demo/Fonty-Demo/main.m b/Fonty-Demo/main.m similarity index 100% rename from Fonty-Demo/Fonty-Demo/main.m rename to Fonty-Demo/main.m diff --git a/Fonty/FYFontManager.h b/Fonty/FYFontManager.h index 2ec37f2..7f41779 100644 --- a/Fonty/FYFontManager.h +++ b/Fonty/FYFontManager.h @@ -11,8 +11,6 @@ @class FYFontModel; -extern const NSInteger FYUsingSystemFontIndex; - @interface FYFontManager : NSObject + (instancetype)sharedManager; diff --git a/Fonty/FYFontManager.m b/Fonty/FYFontManager.m index 1245438..261a981 100644 --- a/Fonty/FYFontManager.m +++ b/Fonty/FYFontManager.m @@ -12,8 +12,6 @@ #import "FYFontDownloader.h" #import "FYFontModel.h" -const NSInteger FYUsingSystemFontIndex = NSIntegerMin; - @interface FYFontManager () @property (nonatomic, strong) FYFontCache *fontCache; @@ -44,7 +42,7 @@ - (instancetype)init _fontCache = [FYFontCache sharedFontCache]; _fontDownloader = [FYFontDownloader sharedDownloader]; _fontRegister = [FYFontRegister sharedRegister]; - _mainFontIndex = FYUsingSystemFontIndex; + _mainFontIndex = 0; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeModelStatus:) name:FYNewFontDownloadNotification @@ -53,6 +51,11 @@ - (instancetype)init return self; } +- (void)dealloc +{ + [[NSNotificationCenter defaultCenter] removeObserver:self]; +} + #pragma mark - Public - (UIFont *)fontWithURL:(NSURL *)URL size:(CGFloat)size { @@ -146,6 +149,12 @@ - (void)setFontURLStringArray:(NSArray *)fontURLStringArray { _fontURLStringArray = fontURLStringArray; NSMutableArray *fontModelArray = [NSMutableArray array]; + + // stand for system default font + [fontModelArray addObject:[FYFontModel modelWithURL:nil + status:FYFontModelDownloadStatusDownloaded + downloadProgress:0.0f]]; + [fontURLStringArray enumerateObjectsUsingBlock:^(NSString * _Nonnull URLString, NSUInteger idx, BOOL * _Nonnull stop) { if ([URLString isKindOfClass:[NSString class]]) { NSURL *URL = [NSURL URLWithString:URLString]; diff --git a/Fonty/FYFontModel.m b/Fonty/FYFontModel.m index 2dbcf71..8982512 100644 --- a/Fonty/FYFontModel.m +++ b/Fonty/FYFontModel.m @@ -10,6 +10,15 @@ @implementation FYFontModel +- (NSString *)description +{ + if (self.URL) { + return self.URL.absoluteString; + } else { + return @"system default font"; + } +} + + (instancetype)modelWithURL:(NSURL *)URL status:(FYFontModelDownloadStatus)status downloadProgress:(float)downloadProgress {