{"id":23635115,"url":"https://github.com/joncardasis/fontfit","last_synced_at":"2025-08-31T10:32:21.809Z","repository":{"id":43719874,"uuid":"212362037","full_name":"joncardasis/FontFit","owner":"joncardasis","description":"↔ Aspect-fit a font inside a view container.","archived":false,"fork":false,"pushed_at":"2019-10-04T15:37:48.000Z","size":5428,"stargazers_count":37,"open_issues_count":0,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2023-08-03T17:02:19.081Z","etag":null,"topics":["aspect-fit","font","size","swift"],"latest_commit_sha":null,"homepage":"https://medium.com/@joncardasis/dynamic-text-resizing-in-swift-3da55887beb3","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/joncardasis.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}},"created_at":"2019-10-02T14:26:48.000Z","updated_at":"2023-06-23T05:38:04.000Z","dependencies_parsed_at":"2022-09-01T09:10:16.004Z","dependency_job_id":null,"html_url":"https://github.com/joncardasis/FontFit","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joncardasis%2FFontFit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joncardasis%2FFontFit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joncardasis%2FFontFit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joncardasis%2FFontFit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joncardasis","download_url":"https://codeload.github.com/joncardasis/FontFit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":231590304,"owners_count":18396921,"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":["aspect-fit","font","size","swift"],"created_at":"2024-12-28T05:30:47.595Z","updated_at":"2024-12-28T05:30:57.734Z","avatar_url":"https://github.com/joncardasis.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n    \u003cimg src=\".github/Logo.png\" width=\"320\" alt=\"ChromaColorPicker 2.0\" /\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Swift-5.0-orange.svg\" /\u003e\n  \u003cimg src=\"https://img.shields.io/badge/platform-iOS-lightgray.svg\" /\u003e\n  \u003cimg src=\"https://img.shields.io/badge/license-MIT-blue.svg\" /\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Carthage-compatible-green.svg\" /\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"./.github/demo1.gif\" width=300 /\u003e\n    \u003cimg src=\"./.github/demo2.gif\" width=300 /\u003e\n\u003c/p\u003e\n\n## Abstract\nFontFit scales the `font` size of a text element (i.e. `UILabel` or `UITextView`) to fill it's container.\n\nFontFit is the missing inverse of `sizeToFit()`. The `FontFit` extensions are a more detailed implementation of UILabel's [adjustsFontSizeToFitWidth](https://developer.apple.com/documentation/uikit/uilabel/1620546-adjustsfontsizetofitwidth) which only _reduces_ font size.\n\n## Examples\n**Note**: A full example use case can be found in the _Example_ project.\n\n```Swift\nlet label = UILabel(frame: ...)\n\n// Increase font to fill the label's frame.\nlabel.fitTextToBounds()\n```\n\n```Swift\nlet label = UILabel(frame: ...)\n\n// Increase font to fill the label's frame, attempting to distribute onto, at most, 2 lines.\nlabel.fitText(maxLines: 2)\n```\n## License\nFontFit is available under the MIT license. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoncardasis%2Ffontfit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoncardasis%2Ffontfit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoncardasis%2Ffontfit/lists"}