├── .gitignore ├── LICENSE ├── README.md ├── SXFontShow ├── SXFontShow.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata ├── SXFontShow │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Base.lproj │ │ ├── LaunchScreen.xib │ │ └── Main.storyboard │ ├── Images.xcassets │ │ └── AppIcon.appiconset │ │ │ ├── 001.png │ │ │ └── Contents.json │ ├── Info.plist │ ├── SXFontShowVC.h │ ├── SXFontShowVC.m │ └── main.m └── SXFontShowTests │ ├── Info.plist │ └── SXFontShowTests.m └── screenshots ├── 104.png └── 106.png /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | build/ 4 | *.pbxuser 5 | !default.pbxuser 6 | *.mode1v3 7 | !default.mode1v3 8 | *.mode2v3 9 | !default.mode2v3 10 | *.perspectivev3 11 | !default.perspectivev3 12 | xcuserdata 13 | *.xccheckout 14 | *.moved-aside 15 | DerivedData 16 | *.hmap 17 | *.ipa 18 | *.xcuserstate 19 | 20 | # CocoaPods 21 | # 22 | # We recommend against adding the Pods directory to your .gitignore. However 23 | # you should judge for yourself, the pros and cons are mentioned at: 24 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 25 | # 26 | #Pods/ 27 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 董铂然 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SXFontShow 2 | iOS字体相关 3 | 4 | ![image](https://github.com/dsxNiubility/SXFontShow/raw/master/screenshots/104.png)
5 | 6 | ![image](https://github.com/dsxNiubility/SXFontShow/raw/master/screenshots/106.png)
7 | 8 | * 主要可查看所有系统原生字体的显示样式 9 | * 分为简版和详细版两种 10 | * 用UIFont开放的API遍历展示的 11 | -------------------------------------------------------------------------------- /SXFontShow/SXFontShow.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1D007FA21B6E04AE00EA119C /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D007FA11B6E04AE00EA119C /* main.m */; }; 11 | 1D007FA51B6E04AE00EA119C /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D007FA41B6E04AE00EA119C /* AppDelegate.m */; }; 12 | 1D007FA81B6E04AE00EA119C /* SXFontShowVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D007FA71B6E04AE00EA119C /* SXFontShowVC.m */; }; 13 | 1D007FAD1B6E04AE00EA119C /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 1D007FAC1B6E04AE00EA119C /* Images.xcassets */; }; 14 | 1D007FB01B6E04AE00EA119C /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1D007FAE1B6E04AE00EA119C /* LaunchScreen.xib */; }; 15 | 1D007FBC1B6E04AE00EA119C /* SXFontShowTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D007FBB1B6E04AE00EA119C /* SXFontShowTests.m */; }; 16 | 1D007FC71B6E147700EA119C /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 1D007FC51B6E147700EA119C /* Main.storyboard */; }; 17 | /* End PBXBuildFile section */ 18 | 19 | /* Begin PBXContainerItemProxy section */ 20 | 1D007FB61B6E04AE00EA119C /* PBXContainerItemProxy */ = { 21 | isa = PBXContainerItemProxy; 22 | containerPortal = 1D007F941B6E04AE00EA119C /* Project object */; 23 | proxyType = 1; 24 | remoteGlobalIDString = 1D007F9B1B6E04AE00EA119C; 25 | remoteInfo = SXFontShow; 26 | }; 27 | /* End PBXContainerItemProxy section */ 28 | 29 | /* Begin PBXFileReference section */ 30 | 1D007F9C1B6E04AE00EA119C /* SXFontShow.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SXFontShow.app; sourceTree = BUILT_PRODUCTS_DIR; }; 31 | 1D007FA01B6E04AE00EA119C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 32 | 1D007FA11B6E04AE00EA119C /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 33 | 1D007FA31B6E04AE00EA119C /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 34 | 1D007FA41B6E04AE00EA119C /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 35 | 1D007FA61B6E04AE00EA119C /* SXFontShowVC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SXFontShowVC.h; sourceTree = ""; }; 36 | 1D007FA71B6E04AE00EA119C /* SXFontShowVC.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SXFontShowVC.m; sourceTree = ""; }; 37 | 1D007FAC1B6E04AE00EA119C /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 38 | 1D007FAF1B6E04AE00EA119C /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 39 | 1D007FB51B6E04AE00EA119C /* SXFontShowTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SXFontShowTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 40 | 1D007FBA1B6E04AE00EA119C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 41 | 1D007FBB1B6E04AE00EA119C /* SXFontShowTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SXFontShowTests.m; sourceTree = ""; }; 42 | 1D007FC61B6E147700EA119C /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 43 | /* End PBXFileReference section */ 44 | 45 | /* Begin PBXFrameworksBuildPhase section */ 46 | 1D007F991B6E04AE00EA119C /* Frameworks */ = { 47 | isa = PBXFrameworksBuildPhase; 48 | buildActionMask = 2147483647; 49 | files = ( 50 | ); 51 | runOnlyForDeploymentPostprocessing = 0; 52 | }; 53 | 1D007FB21B6E04AE00EA119C /* Frameworks */ = { 54 | isa = PBXFrameworksBuildPhase; 55 | buildActionMask = 2147483647; 56 | files = ( 57 | ); 58 | runOnlyForDeploymentPostprocessing = 0; 59 | }; 60 | /* End PBXFrameworksBuildPhase section */ 61 | 62 | /* Begin PBXGroup section */ 63 | 1D007F931B6E04AE00EA119C = { 64 | isa = PBXGroup; 65 | children = ( 66 | 1D007F9E1B6E04AE00EA119C /* SXFontShow */, 67 | 1D007FB81B6E04AE00EA119C /* SXFontShowTests */, 68 | 1D007F9D1B6E04AE00EA119C /* Products */, 69 | ); 70 | sourceTree = ""; 71 | }; 72 | 1D007F9D1B6E04AE00EA119C /* Products */ = { 73 | isa = PBXGroup; 74 | children = ( 75 | 1D007F9C1B6E04AE00EA119C /* SXFontShow.app */, 76 | 1D007FB51B6E04AE00EA119C /* SXFontShowTests.xctest */, 77 | ); 78 | name = Products; 79 | sourceTree = ""; 80 | }; 81 | 1D007F9E1B6E04AE00EA119C /* SXFontShow */ = { 82 | isa = PBXGroup; 83 | children = ( 84 | 1D007FA61B6E04AE00EA119C /* SXFontShowVC.h */, 85 | 1D007FA71B6E04AE00EA119C /* SXFontShowVC.m */, 86 | 1D007F9F1B6E04AE00EA119C /* Supporting Files */, 87 | ); 88 | path = SXFontShow; 89 | sourceTree = ""; 90 | }; 91 | 1D007F9F1B6E04AE00EA119C /* Supporting Files */ = { 92 | isa = PBXGroup; 93 | children = ( 94 | 1D007FA31B6E04AE00EA119C /* AppDelegate.h */, 95 | 1D007FA41B6E04AE00EA119C /* AppDelegate.m */, 96 | 1D007FC51B6E147700EA119C /* Main.storyboard */, 97 | 1D007FAC1B6E04AE00EA119C /* Images.xcassets */, 98 | 1D007FAE1B6E04AE00EA119C /* LaunchScreen.xib */, 99 | 1D007FA01B6E04AE00EA119C /* Info.plist */, 100 | 1D007FA11B6E04AE00EA119C /* main.m */, 101 | ); 102 | name = "Supporting Files"; 103 | sourceTree = ""; 104 | }; 105 | 1D007FB81B6E04AE00EA119C /* SXFontShowTests */ = { 106 | isa = PBXGroup; 107 | children = ( 108 | 1D007FBB1B6E04AE00EA119C /* SXFontShowTests.m */, 109 | 1D007FB91B6E04AE00EA119C /* Supporting Files */, 110 | ); 111 | path = SXFontShowTests; 112 | sourceTree = ""; 113 | }; 114 | 1D007FB91B6E04AE00EA119C /* Supporting Files */ = { 115 | isa = PBXGroup; 116 | children = ( 117 | 1D007FBA1B6E04AE00EA119C /* Info.plist */, 118 | ); 119 | name = "Supporting Files"; 120 | sourceTree = ""; 121 | }; 122 | /* End PBXGroup section */ 123 | 124 | /* Begin PBXNativeTarget section */ 125 | 1D007F9B1B6E04AE00EA119C /* SXFontShow */ = { 126 | isa = PBXNativeTarget; 127 | buildConfigurationList = 1D007FBF1B6E04AE00EA119C /* Build configuration list for PBXNativeTarget "SXFontShow" */; 128 | buildPhases = ( 129 | 1D007F981B6E04AE00EA119C /* Sources */, 130 | 1D007F991B6E04AE00EA119C /* Frameworks */, 131 | 1D007F9A1B6E04AE00EA119C /* Resources */, 132 | ); 133 | buildRules = ( 134 | ); 135 | dependencies = ( 136 | ); 137 | name = SXFontShow; 138 | productName = SXFontShow; 139 | productReference = 1D007F9C1B6E04AE00EA119C /* SXFontShow.app */; 140 | productType = "com.apple.product-type.application"; 141 | }; 142 | 1D007FB41B6E04AE00EA119C /* SXFontShowTests */ = { 143 | isa = PBXNativeTarget; 144 | buildConfigurationList = 1D007FC21B6E04AE00EA119C /* Build configuration list for PBXNativeTarget "SXFontShowTests" */; 145 | buildPhases = ( 146 | 1D007FB11B6E04AE00EA119C /* Sources */, 147 | 1D007FB21B6E04AE00EA119C /* Frameworks */, 148 | 1D007FB31B6E04AE00EA119C /* Resources */, 149 | ); 150 | buildRules = ( 151 | ); 152 | dependencies = ( 153 | 1D007FB71B6E04AE00EA119C /* PBXTargetDependency */, 154 | ); 155 | name = SXFontShowTests; 156 | productName = SXFontShowTests; 157 | productReference = 1D007FB51B6E04AE00EA119C /* SXFontShowTests.xctest */; 158 | productType = "com.apple.product-type.bundle.unit-test"; 159 | }; 160 | /* End PBXNativeTarget section */ 161 | 162 | /* Begin PBXProject section */ 163 | 1D007F941B6E04AE00EA119C /* Project object */ = { 164 | isa = PBXProject; 165 | attributes = { 166 | LastUpgradeCheck = 0630; 167 | ORGANIZATIONNAME = Sankuai; 168 | TargetAttributes = { 169 | 1D007F9B1B6E04AE00EA119C = { 170 | CreatedOnToolsVersion = 6.3; 171 | }; 172 | 1D007FB41B6E04AE00EA119C = { 173 | CreatedOnToolsVersion = 6.3; 174 | TestTargetID = 1D007F9B1B6E04AE00EA119C; 175 | }; 176 | }; 177 | }; 178 | buildConfigurationList = 1D007F971B6E04AE00EA119C /* Build configuration list for PBXProject "SXFontShow" */; 179 | compatibilityVersion = "Xcode 3.2"; 180 | developmentRegion = English; 181 | hasScannedForEncodings = 0; 182 | knownRegions = ( 183 | en, 184 | Base, 185 | ); 186 | mainGroup = 1D007F931B6E04AE00EA119C; 187 | productRefGroup = 1D007F9D1B6E04AE00EA119C /* Products */; 188 | projectDirPath = ""; 189 | projectRoot = ""; 190 | targets = ( 191 | 1D007F9B1B6E04AE00EA119C /* SXFontShow */, 192 | 1D007FB41B6E04AE00EA119C /* SXFontShowTests */, 193 | ); 194 | }; 195 | /* End PBXProject section */ 196 | 197 | /* Begin PBXResourcesBuildPhase section */ 198 | 1D007F9A1B6E04AE00EA119C /* Resources */ = { 199 | isa = PBXResourcesBuildPhase; 200 | buildActionMask = 2147483647; 201 | files = ( 202 | 1D007FC71B6E147700EA119C /* Main.storyboard in Resources */, 203 | 1D007FB01B6E04AE00EA119C /* LaunchScreen.xib in Resources */, 204 | 1D007FAD1B6E04AE00EA119C /* Images.xcassets in Resources */, 205 | ); 206 | runOnlyForDeploymentPostprocessing = 0; 207 | }; 208 | 1D007FB31B6E04AE00EA119C /* Resources */ = { 209 | isa = PBXResourcesBuildPhase; 210 | buildActionMask = 2147483647; 211 | files = ( 212 | ); 213 | runOnlyForDeploymentPostprocessing = 0; 214 | }; 215 | /* End PBXResourcesBuildPhase section */ 216 | 217 | /* Begin PBXSourcesBuildPhase section */ 218 | 1D007F981B6E04AE00EA119C /* Sources */ = { 219 | isa = PBXSourcesBuildPhase; 220 | buildActionMask = 2147483647; 221 | files = ( 222 | 1D007FA81B6E04AE00EA119C /* SXFontShowVC.m in Sources */, 223 | 1D007FA51B6E04AE00EA119C /* AppDelegate.m in Sources */, 224 | 1D007FA21B6E04AE00EA119C /* main.m in Sources */, 225 | ); 226 | runOnlyForDeploymentPostprocessing = 0; 227 | }; 228 | 1D007FB11B6E04AE00EA119C /* Sources */ = { 229 | isa = PBXSourcesBuildPhase; 230 | buildActionMask = 2147483647; 231 | files = ( 232 | 1D007FBC1B6E04AE00EA119C /* SXFontShowTests.m in Sources */, 233 | ); 234 | runOnlyForDeploymentPostprocessing = 0; 235 | }; 236 | /* End PBXSourcesBuildPhase section */ 237 | 238 | /* Begin PBXTargetDependency section */ 239 | 1D007FB71B6E04AE00EA119C /* PBXTargetDependency */ = { 240 | isa = PBXTargetDependency; 241 | target = 1D007F9B1B6E04AE00EA119C /* SXFontShow */; 242 | targetProxy = 1D007FB61B6E04AE00EA119C /* PBXContainerItemProxy */; 243 | }; 244 | /* End PBXTargetDependency section */ 245 | 246 | /* Begin PBXVariantGroup section */ 247 | 1D007FAE1B6E04AE00EA119C /* LaunchScreen.xib */ = { 248 | isa = PBXVariantGroup; 249 | children = ( 250 | 1D007FAF1B6E04AE00EA119C /* Base */, 251 | ); 252 | name = LaunchScreen.xib; 253 | sourceTree = ""; 254 | }; 255 | 1D007FC51B6E147700EA119C /* Main.storyboard */ = { 256 | isa = PBXVariantGroup; 257 | children = ( 258 | 1D007FC61B6E147700EA119C /* Base */, 259 | ); 260 | name = Main.storyboard; 261 | sourceTree = ""; 262 | }; 263 | /* End PBXVariantGroup section */ 264 | 265 | /* Begin XCBuildConfiguration section */ 266 | 1D007FBD1B6E04AE00EA119C /* Debug */ = { 267 | isa = XCBuildConfiguration; 268 | buildSettings = { 269 | ALWAYS_SEARCH_USER_PATHS = NO; 270 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 271 | CLANG_CXX_LIBRARY = "libc++"; 272 | CLANG_ENABLE_MODULES = YES; 273 | CLANG_ENABLE_OBJC_ARC = YES; 274 | CLANG_WARN_BOOL_CONVERSION = YES; 275 | CLANG_WARN_CONSTANT_CONVERSION = YES; 276 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 277 | CLANG_WARN_EMPTY_BODY = YES; 278 | CLANG_WARN_ENUM_CONVERSION = YES; 279 | CLANG_WARN_INT_CONVERSION = YES; 280 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 281 | CLANG_WARN_UNREACHABLE_CODE = YES; 282 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 283 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 284 | COPY_PHASE_STRIP = NO; 285 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 286 | ENABLE_STRICT_OBJC_MSGSEND = YES; 287 | GCC_C_LANGUAGE_STANDARD = gnu99; 288 | GCC_DYNAMIC_NO_PIC = NO; 289 | GCC_NO_COMMON_BLOCKS = YES; 290 | GCC_OPTIMIZATION_LEVEL = 0; 291 | GCC_PREPROCESSOR_DEFINITIONS = ( 292 | "DEBUG=1", 293 | "$(inherited)", 294 | ); 295 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 296 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 297 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 298 | GCC_WARN_UNDECLARED_SELECTOR = YES; 299 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 300 | GCC_WARN_UNUSED_FUNCTION = YES; 301 | GCC_WARN_UNUSED_VARIABLE = YES; 302 | IPHONEOS_DEPLOYMENT_TARGET = 8.3; 303 | MTL_ENABLE_DEBUG_INFO = YES; 304 | ONLY_ACTIVE_ARCH = YES; 305 | SDKROOT = iphoneos; 306 | TARGETED_DEVICE_FAMILY = "1,2"; 307 | }; 308 | name = Debug; 309 | }; 310 | 1D007FBE1B6E04AE00EA119C /* Release */ = { 311 | isa = XCBuildConfiguration; 312 | buildSettings = { 313 | ALWAYS_SEARCH_USER_PATHS = NO; 314 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 315 | CLANG_CXX_LIBRARY = "libc++"; 316 | CLANG_ENABLE_MODULES = YES; 317 | CLANG_ENABLE_OBJC_ARC = YES; 318 | CLANG_WARN_BOOL_CONVERSION = YES; 319 | CLANG_WARN_CONSTANT_CONVERSION = YES; 320 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 321 | CLANG_WARN_EMPTY_BODY = YES; 322 | CLANG_WARN_ENUM_CONVERSION = YES; 323 | CLANG_WARN_INT_CONVERSION = YES; 324 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 325 | CLANG_WARN_UNREACHABLE_CODE = YES; 326 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 327 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 328 | COPY_PHASE_STRIP = NO; 329 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 330 | ENABLE_NS_ASSERTIONS = NO; 331 | ENABLE_STRICT_OBJC_MSGSEND = YES; 332 | GCC_C_LANGUAGE_STANDARD = gnu99; 333 | GCC_NO_COMMON_BLOCKS = YES; 334 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 335 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 336 | GCC_WARN_UNDECLARED_SELECTOR = YES; 337 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 338 | GCC_WARN_UNUSED_FUNCTION = YES; 339 | GCC_WARN_UNUSED_VARIABLE = YES; 340 | IPHONEOS_DEPLOYMENT_TARGET = 8.3; 341 | MTL_ENABLE_DEBUG_INFO = NO; 342 | SDKROOT = iphoneos; 343 | TARGETED_DEVICE_FAMILY = "1,2"; 344 | VALIDATE_PRODUCT = YES; 345 | }; 346 | name = Release; 347 | }; 348 | 1D007FC01B6E04AE00EA119C /* Debug */ = { 349 | isa = XCBuildConfiguration; 350 | buildSettings = { 351 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 352 | INFOPLIST_FILE = SXFontShow/Info.plist; 353 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 354 | PRODUCT_NAME = "$(TARGET_NAME)"; 355 | }; 356 | name = Debug; 357 | }; 358 | 1D007FC11B6E04AE00EA119C /* Release */ = { 359 | isa = XCBuildConfiguration; 360 | buildSettings = { 361 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 362 | INFOPLIST_FILE = SXFontShow/Info.plist; 363 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 364 | PRODUCT_NAME = "$(TARGET_NAME)"; 365 | }; 366 | name = Release; 367 | }; 368 | 1D007FC31B6E04AE00EA119C /* Debug */ = { 369 | isa = XCBuildConfiguration; 370 | buildSettings = { 371 | BUNDLE_LOADER = "$(TEST_HOST)"; 372 | FRAMEWORK_SEARCH_PATHS = ( 373 | "$(SDKROOT)/Developer/Library/Frameworks", 374 | "$(inherited)", 375 | ); 376 | GCC_PREPROCESSOR_DEFINITIONS = ( 377 | "DEBUG=1", 378 | "$(inherited)", 379 | ); 380 | INFOPLIST_FILE = SXFontShowTests/Info.plist; 381 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 382 | PRODUCT_NAME = "$(TARGET_NAME)"; 383 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SXFontShow.app/SXFontShow"; 384 | }; 385 | name = Debug; 386 | }; 387 | 1D007FC41B6E04AE00EA119C /* Release */ = { 388 | isa = XCBuildConfiguration; 389 | buildSettings = { 390 | BUNDLE_LOADER = "$(TEST_HOST)"; 391 | FRAMEWORK_SEARCH_PATHS = ( 392 | "$(SDKROOT)/Developer/Library/Frameworks", 393 | "$(inherited)", 394 | ); 395 | INFOPLIST_FILE = SXFontShowTests/Info.plist; 396 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 397 | PRODUCT_NAME = "$(TARGET_NAME)"; 398 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SXFontShow.app/SXFontShow"; 399 | }; 400 | name = Release; 401 | }; 402 | /* End XCBuildConfiguration section */ 403 | 404 | /* Begin XCConfigurationList section */ 405 | 1D007F971B6E04AE00EA119C /* Build configuration list for PBXProject "SXFontShow" */ = { 406 | isa = XCConfigurationList; 407 | buildConfigurations = ( 408 | 1D007FBD1B6E04AE00EA119C /* Debug */, 409 | 1D007FBE1B6E04AE00EA119C /* Release */, 410 | ); 411 | defaultConfigurationIsVisible = 0; 412 | defaultConfigurationName = Release; 413 | }; 414 | 1D007FBF1B6E04AE00EA119C /* Build configuration list for PBXNativeTarget "SXFontShow" */ = { 415 | isa = XCConfigurationList; 416 | buildConfigurations = ( 417 | 1D007FC01B6E04AE00EA119C /* Debug */, 418 | 1D007FC11B6E04AE00EA119C /* Release */, 419 | ); 420 | defaultConfigurationIsVisible = 0; 421 | defaultConfigurationName = Release; 422 | }; 423 | 1D007FC21B6E04AE00EA119C /* Build configuration list for PBXNativeTarget "SXFontShowTests" */ = { 424 | isa = XCConfigurationList; 425 | buildConfigurations = ( 426 | 1D007FC31B6E04AE00EA119C /* Debug */, 427 | 1D007FC41B6E04AE00EA119C /* Release */, 428 | ); 429 | defaultConfigurationIsVisible = 0; 430 | defaultConfigurationName = Release; 431 | }; 432 | /* End XCConfigurationList section */ 433 | }; 434 | rootObject = 1D007F941B6E04AE00EA119C /* Project object */; 435 | } 436 | -------------------------------------------------------------------------------- /SXFontShow/SXFontShow.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /SXFontShow/SXFontShow/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // SXFontShow 4 | // 5 | // Created by dongshangxian on 15/8/2. 6 | // Copyright (c) 2015年 Sankuai. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /SXFontShow/SXFontShow/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // SXFontShow 4 | // 5 | // Created by dongshangxian on 15/8/2. 6 | // Copyright (c) 2015年 Sankuai. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | - (void)applicationWillResignActive:(UIApplication *)application { 24 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 25 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 26 | } 27 | 28 | - (void)applicationDidEnterBackground:(UIApplication *)application { 29 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 30 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 31 | } 32 | 33 | - (void)applicationWillEnterForeground:(UIApplication *)application { 34 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 35 | } 36 | 37 | - (void)applicationDidBecomeActive:(UIApplication *)application { 38 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 39 | } 40 | 41 | - (void)applicationWillTerminate:(UIApplication *)application { 42 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /SXFontShow/SXFontShow/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 20 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /SXFontShow/SXFontShow/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /SXFontShow/SXFontShow/Images.xcassets/AppIcon.appiconset/001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dsxNiubility/SXFontShow/856124bfc093ca0f17c8ea17d061bbc62931fd77/SXFontShow/SXFontShow/Images.xcassets/AppIcon.appiconset/001.png -------------------------------------------------------------------------------- /SXFontShow/SXFontShow/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "size" : "60x60", 25 | "idiom" : "iphone", 26 | "filename" : "001.png", 27 | "scale" : "2x" 28 | }, 29 | { 30 | "idiom" : "iphone", 31 | "size" : "60x60", 32 | "scale" : "3x" 33 | }, 34 | { 35 | "idiom" : "ipad", 36 | "size" : "29x29", 37 | "scale" : "1x" 38 | }, 39 | { 40 | "idiom" : "ipad", 41 | "size" : "29x29", 42 | "scale" : "2x" 43 | }, 44 | { 45 | "idiom" : "ipad", 46 | "size" : "40x40", 47 | "scale" : "1x" 48 | }, 49 | { 50 | "idiom" : "ipad", 51 | "size" : "40x40", 52 | "scale" : "2x" 53 | }, 54 | { 55 | "idiom" : "ipad", 56 | "size" : "76x76", 57 | "scale" : "1x" 58 | }, 59 | { 60 | "idiom" : "ipad", 61 | "size" : "76x76", 62 | "scale" : "2x" 63 | } 64 | ], 65 | "info" : { 66 | "version" : 1, 67 | "author" : "xcode" 68 | } 69 | } -------------------------------------------------------------------------------- /SXFontShow/SXFontShow/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | com.Sankuai.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | SXFont 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /SXFontShow/SXFontShow/SXFontShowVC.h: -------------------------------------------------------------------------------- 1 | // 2 | // SXFontShowVC.h 3 | // SXFontShow 4 | // 5 | // Created by dongshangxian on 15/8/2. 6 | // Copyright (c) 2015年 Sankuai. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface SXFontShowVC : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /SXFontShow/SXFontShow/SXFontShowVC.m: -------------------------------------------------------------------------------- 1 | // 2 | // SXFontShowVC.m 3 | // SXFontShow 4 | // 5 | // Created by dongshangxian on 15/8/2. 6 | // Copyright (c) 2015年 Sankuai. All rights reserved. 7 | // 8 | 9 | #import "SXFontShowVC.h" 10 | 11 | #define SCREEN_WIDTH [UIScreen mainScreen].bounds.size.width 12 | #define SCREEN_HEIGHT [UIScreen mainScreen].bounds.size.height 13 | 14 | @interface SXFontShowVC () 15 | @property (nonatomic,strong)UITableView * tableView; 16 | @property (nonatomic,strong)UITableView * tableView2; 17 | @end 18 | 19 | @implementation SXFontShowVC 20 | 21 | #pragma mark - **************** 初始样式 22 | 23 | - (void)viewDidLoad 24 | { 25 | [super viewDidLoad]; 26 | 27 | _tableView=[[UITableView alloc] initWithFrame:CGRectMake(0, 40, SCREEN_WIDTH, SCREEN_HEIGHT-40)style:UITableViewStyleGrouped]; 28 | _tableView.delegate=self; 29 | _tableView.dataSource=self; 30 | [self.view addSubview:_tableView]; 31 | 32 | _tableView2=[[UITableView alloc] initWithFrame:_tableView.frame style:UITableViewStyleGrouped]; 33 | _tableView2.delegate=self; 34 | _tableView2.dataSource=self; 35 | [self.view addSubview:_tableView2]; 36 | 37 | UIView *topView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 40)]; 38 | topView.backgroundColor = [UIColor darkGrayColor]; 39 | [self.view addSubview:topView]; 40 | 41 | UIButton *btnLess = [[UIButton alloc]initWithFrame:CGRectMake(SCREEN_WIDTH/4, 0, SCREEN_WIDTH/4, 40)]; 42 | UIButton *btnMore = [[UIButton alloc]initWithFrame:CGRectMake(SCREEN_WIDTH/2, 0, SCREEN_WIDTH/4, 40)]; 43 | 44 | [btnLess setTitle:@"精简显示" forState:UIControlStateNormal]; 45 | [btnMore setTitle:@"完整显示" forState:UIControlStateNormal]; 46 | btnLess.tag = 50; 47 | btnMore.tag = 51; 48 | 49 | [btnLess addTarget:self action:@selector(topClickWithSender:) forControlEvents:UIControlEventTouchUpInside]; 50 | [btnMore addTarget:self action:@selector(topClickWithSender:) forControlEvents:UIControlEventTouchUpInside]; 51 | 52 | [topView addSubview:btnLess]; 53 | [topView addSubview:btnMore]; 54 | 55 | [self topClickWithSender:btnLess]; 56 | } 57 | 58 | - (void)topClickWithSender:(UIButton *)button 59 | { 60 | if (button.tag == 50) { 61 | _tableView.hidden = NO; 62 | _tableView2.hidden = YES; 63 | }else if (button.tag == 51){ 64 | _tableView.hidden = YES; 65 | _tableView2.hidden = NO; 66 | } 67 | 68 | } 69 | 70 | - (BOOL)prefersStatusBarHidden{ 71 | return YES; 72 | } 73 | 74 | #pragma mark - **************** UITableViewDataSource 75 | 76 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView 77 | { 78 | //字体家族总数 79 | return [[UIFont familyNames] count]; 80 | } 81 | 82 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section 83 | { 84 | if (tableView == self.tableView) { 85 | return 1; 86 | }else{ 87 | //字体家族包括的字体库总数 88 | return [[UIFont fontNamesForFamilyName:[[UIFont familyNames] objectAtIndex:section] ] count]; 89 | } 90 | } 91 | 92 | - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section 93 | { 94 | if (tableView == self.tableView) { 95 | return @""; 96 | }else{ 97 | return [[UIFont familyNames] objectAtIndex:section]; 98 | } 99 | } 100 | 101 | - (NSInteger)tableView:(UITableView *)tableView sectionForSectionIndexTitle:(NSString *)title atIndex:(NSInteger)index 102 | { 103 | [tableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:index] atScrollPosition:UITableViewScrollPositionMiddle animated:NO]; 104 | return index; 105 | } 106 | 107 | int a = 0; 108 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 109 | 110 | { 111 | 112 | static NSString *CellIdentifier = @"Cell"; 113 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; 114 | if (cell == nil) { 115 | if (tableView == self.tableView) { 116 | cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:CellIdentifier]; 117 | }else{ 118 | cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier]; 119 | } 120 | } 121 | 122 | NSString *familyName= [[UIFont familyNames] objectAtIndex:indexPath.section]; 123 | 124 | NSArray *fontNameArray = [UIFont fontNamesForFamilyName:familyName]; 125 | if (fontNameArray.count < 1) { 126 | cell.textLabel.text = [NSString stringWithFormat:@"%@字体在iOS9后废弃了",familyName]; 127 | cell.detailTextLabel.text = @""; 128 | cell.textLabel.font = [UIFont systemFontOfSize:10]; 129 | return cell; 130 | } 131 | NSString *fontName = [fontNameArray objectAtIndex:indexPath.row]; 132 | 133 | if (tableView == self.tableView) { 134 | cell.textLabel.text=@"DSXNiubility-2015@;"; 135 | cell.detailTextLabel.text = [NSString stringWithFormat:@"%@", familyName]; 136 | cell.textLabel.font = [UIFont fontWithName:fontName size:20.0f]; 137 | cell.detailTextLabel.font = [UIFont fontWithName:fontName size:12.0f]; 138 | }else{ 139 | cell.textLabel.text=@"董铂然-DSX-dantesx2012@gmail.com"; 140 | cell.detailTextLabel.text = [NSString stringWithFormat:@"%d - %@",a++,fontName]; 141 | cell.textLabel.font = [UIFont fontWithName:fontName size:16.0f]; 142 | } 143 | 144 | return cell; 145 | } 146 | 147 | #pragma mark - **************** UITableViewDelegate 148 | 149 | - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section 150 | { 151 | if (tableView == self.tableView) { 152 | return CGFLOAT_MIN; 153 | }else{ 154 | return 30; 155 | } 156 | } 157 | 158 | - (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section 159 | { 160 | if (tableView == self.tableView) { 161 | return CGFLOAT_MIN; 162 | }else{ 163 | return 10; 164 | } 165 | } 166 | 167 | -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 168 | { 169 | 170 | NSString *familyName= [[UIFont familyNames] objectAtIndex:indexPath.section]; 171 | NSString *fontName = [[UIFont fontNamesForFamilyName:[[UIFont familyNames] objectAtIndex:indexPath.section]] objectAtIndex:indexPath.row]; 172 | 173 | NSLog(@"%@-%@",familyName,fontName); 174 | 175 | } 176 | 177 | @end 178 | -------------------------------------------------------------------------------- /SXFontShow/SXFontShow/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // SXFontShow 4 | // 5 | // Created by dongshangxian on 15/8/2. 6 | // Copyright (c) 2015年 Sankuai. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /SXFontShow/SXFontShowTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | com.Sankuai.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /SXFontShow/SXFontShowTests/SXFontShowTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // SXFontShowTests.m 3 | // SXFontShowTests 4 | // 5 | // Created by dongshangxian on 15/8/2. 6 | // Copyright (c) 2015年 Sankuai. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface SXFontShowTests : XCTestCase 13 | 14 | @end 15 | 16 | @implementation SXFontShowTests 17 | 18 | - (void)setUp { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown { 24 | // Put teardown code here. This method is called after the invocation of each test method in the class. 25 | [super tearDown]; 26 | } 27 | 28 | - (void)testExample { 29 | // This is an example of a functional test case. 30 | XCTAssert(YES, @"Pass"); 31 | } 32 | 33 | - (void)testPerformanceExample { 34 | // This is an example of a performance test case. 35 | [self measureBlock:^{ 36 | // Put the code you want to measure the time of here. 37 | }]; 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /screenshots/104.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dsxNiubility/SXFontShow/856124bfc093ca0f17c8ea17d061bbc62931fd77/screenshots/104.png -------------------------------------------------------------------------------- /screenshots/106.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dsxNiubility/SXFontShow/856124bfc093ca0f17c8ea17d061bbc62931fd77/screenshots/106.png --------------------------------------------------------------------------------