{"id":13465740,"url":"https://github.com/hemantasapkota/OpenSansSwift","last_synced_at":"2025-03-25T16:32:41.279Z","repository":{"id":150766790,"uuid":"30905422","full_name":"hemantasapkota/OpenSansSwift","owner":"hemantasapkota","description":"Easily use the OpenSans font in Swift","archived":false,"fork":false,"pushed_at":"2017-11-06T23:03:17.000Z","size":1042,"stargazers_count":41,"open_issues_count":1,"forks_count":7,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-17T20:38:35.241Z","etag":null,"topics":["carthage","opensans","opensans-font","swift"],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hemantasapkota.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2015-02-17T06:30:38.000Z","updated_at":"2024-09-10T15:01:46.000Z","dependencies_parsed_at":"2023-05-20T20:30:34.933Z","dependency_job_id":null,"html_url":"https://github.com/hemantasapkota/OpenSansSwift","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hemantasapkota%2FOpenSansSwift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hemantasapkota%2FOpenSansSwift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hemantasapkota%2FOpenSansSwift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hemantasapkota%2FOpenSansSwift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hemantasapkota","download_url":"https://codeload.github.com/hemantasapkota/OpenSansSwift/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245500450,"owners_count":20625582,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["carthage","opensans","opensans-font","swift"],"created_at":"2024-07-31T15:00:34.670Z","updated_at":"2025-03-25T16:32:40.807Z","avatar_url":"https://github.com/hemantasapkota.png","language":"Swift","funding_links":[],"categories":["Libs","Fonts [🔝](#readme)","Swift"],"sub_categories":["Fonts"],"readme":"[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n\n## OpenSansSwift ##\nEasily use the OpenSans font in Swift.\n\n![Screenshot](OpenSans-SS.png)\n\n## Why use OpenSansSwift frameworks ? ##\n\nThe usual process of embedding any custom fonts in your IOS applications has a few steps:\n\n1. Copy all your font resources to your project\n2. Make sure they're copied to the bundle\n3. Add UIAppFonts key to info.plist.\n4. Painstakingly add all the font names with the right extension\n5. Find out the font family and font names programatically\n6. Use the fonts\n\nFor the OpenSans font, this framework does all that for you. All you have to do is link the compiled framework.\n\n## How to Install - Carthage ##\n\nIf you dont' already have Carthage, Install it with:\n\n```\n$ brew update\n$ brew install carthage\n```\n\nAdd ```github \"hemantasapkota/OpenSansSwift\"``` to your Cartfile.\n\nExecute ```carthage install```\n\n## Swift 3 ##\n\nAdd ```github \"hemantasapkota/OpenSansSwift\" \"swift3\"``` to your Cartfile.\n\nExecute ```carthage install```\n\n## How to Install - Manual ##\n\nClone the repo and add ```OpenSansSwift.xcodeproj``` to you project. Link ```OpenSansSwift.framework``` to your project.\n\n## OpenSans Font Methods ##\n\nBased on *OpenSans v2.0*, *OpenSansSwift* registers the following methods:\n\n```\n    openSansFontOfSize(size: Float) -\u003e UIFont!\n    openSansBoldFontOfSize(size: Float) -\u003e UIFont!\n    openSansBoldItalicFontOfSize(size: Float) -\u003e UIFont!\n    openSansExtraBoldFontOfSize(size: Float) -\u003e UIFont!\n    openSansExtraBoldItalicFontOfSize(size: Float) -\u003e UIFont!\n    openSansItalicFontOfSize(size: Float) -\u003e UIFont!\n    openSansLightFontOfSize(size: Float) -\u003e UIFont!\n    openSansLightItalicFontOfSize(size: Float) -\u003e UIFont!\n    openSansSemiboldFontOfSize(size: Float) -\u003e UIFont!\n    openSansSemiboldItalicFontOfSize(size: Float) -\u003e UIFont!\n```\n\n## Retina Scale Factor ##\nSet ```OpenSans.retinaScaleFactor``` to scale out font sizes for the iPad. Default is 2.\n\n## Usage - Programmatically ##\n\nSee Example for more details.\n\n```\nimport UIKit\nimport OpenSansSwift\n\nclass ViewController: UIViewController {\n\n    override func viewDidLoad() {\n        super.viewDidLoad()    \n        \n        //Register Open Sans fonts. Register only once.\n        OpenSans.registerFonts()\n        \n        // Set the scale for iPad. Default is 2.\n        OpenSans.retinaScaleFactor = 1.5\n        \n        // Create a label\n        let lbl1 = UILabel(frame: CGRectMake(x, y, size.width, size.height))\n        \n        lbl1.font = UIFont.openSansFontOfSize(30)\n        \n        lbl1.text = \"This is OpenSans-Regular\"\n        self.view.addSubView(lbl1)\n    }\n}\n```\n\n## Usage - Storyboard ##\n\nXCode automatically detects the fonts present in the bundle, so you don't have to perform any registration for use in Storyboards.\n\n![Screenshot](OpenSans-StoryBoard.png)\n\n## Usage - With NSAttributedString ##\n\nFor use with NSAttributedString, Use the following strings: OpenSans, OpenSans-Bold, OpenSans-Italic\n\n```\nlet regularAttribute = [NSFontAttributeName: UIFont(name: \"OpenSans\", size: 12)!]\nlet boldAttribute = [NSFontAttributeName: UIFont(name: \"OpenSans-Bold\", size: 12)!]\nlet italicAttribute = [NSFontAttributeName: UIFont(name: \"OpenSans-Italic\", size: 12)!]\n```\n\n## Licence ##\n\n* MIT for OpenSansSwift framework.\n\n* Apache for OpenSans v2.0 fonts. See http://www.apache.org/licenses/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhemantasapkota%2FOpenSansSwift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhemantasapkota%2FOpenSansSwift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhemantasapkota%2FOpenSansSwift/lists"}