{"id":15879102,"url":"https://github.com/keyz/comicsans","last_synced_at":"2026-02-20T17:32:24.689Z","repository":{"id":254792961,"uuid":"846636589","full_name":"keyz/comicsans","owner":"keyz","description":"cs (comic sans) for :pink-slack-emoji:","archived":false,"fork":false,"pushed_at":"2024-12-02T07:36:37.000Z","size":143,"stargazers_count":4,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-01T14:44:08.243Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/keyz.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,"publiccode":null,"codemeta":null}},"created_at":"2024-08-23T16:18:40.000Z","updated_at":"2025-10-30T20:27:42.000Z","dependencies_parsed_at":"2025-04-09T19:51:48.761Z","dependency_job_id":"defcbeb9-eb65-44eb-9786-b208ccb92256","html_url":"https://github.com/keyz/comicsans","commit_stats":null,"previous_names":["keyz/comicsans"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/keyz/comicsans","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keyz%2Fcomicsans","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keyz%2Fcomicsans/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keyz%2Fcomicsans/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keyz%2Fcomicsans/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/keyz","download_url":"https://codeload.github.com/keyz/comicsans/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keyz%2Fcomicsans/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29658373,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-20T16:33:43.953Z","status":"ssl_error","status_checked_at":"2026-02-20T16:33:43.598Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2024-10-06T03:00:43.245Z","updated_at":"2026-02-20T17:32:24.653Z","avatar_url":"https://github.com/keyz.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# comicsans\n\n## Install\n\n```bash\n$ brew install keyz/tap/comicsans\n```\n\n## Usage\n\n```bash\n# pass text as an argument\n$ cs 'Write something here and get a png back'\nFile generated: ./write-something-here-and-get-a-png-back.png\n\n# or pass text through a pipe\n$ echo -n 'seems legit' | cs -\nFile generated: ./seems-legit.png\n```\n\n\u003cimg src=\"./.github/assets/write-something-here-and-get-a-png-back.png\" alt=\"write-something-here-and-get-a-png-back.png\" width=\"160\" /\u003e\n\n## How does it work?\n\nFitting text to a container is not a trivial problem. On web this can be done with an off-screen render-measure-resize loop, like [`STRML/textFit`](https://github.com/STRML/textFit) (which powers https://keyan.io/pink).\n\nWithout a browser environment we need a rendering engine with good typography support. Turns out SwiftUI's [`minimumScaleFactor`](https://developer.apple.com/documentation/swiftui/environmentvalues/minimumscalefactor) handling is pretty good at this:\n\n1. Text goes to an off-screen SwiftUI text view, with an arbitrarily large font size and high `minimumScaleFactor`\n2. SwiftUI resizes the text to fit the container\n3. [`ImageRenderer`](https://developer.apple.com/documentation/swiftui/imagerenderer) rasterizes the view into a PNG bitmap\n\n## More options\n\n```\nOVERVIEW: cs (comic sans) for :pink-slack-emoji:\n\nConverts text to pink comic sans slack emoji. https://github.com/keyz/comicsans\n\nUSAGE: Pass text as an argument:\n       $ cs 'Write something here and get a png back'\n\n       Or pass text through a pipe:\n       $ echo -n 'seems legit' | cs -\n\nARGUMENTS:\n  \u003ctext\u003e                  Text to convert\n\nOPTIONS:\n  -p, --padding \u003cpadding\u003e Padding (values: 0, 4, 8, 12, 16, 20, 24) (default: 4)\n  -h, --horizontal \u003chorizontal\u003e\n                          Horizontal alignment (values: leading, center,\n                          trailing; default: leading)\n  -v, --vertical \u003cvertical\u003e\n                          Vertical alignment (values: top, center, bottom;\n                          default: center)\n  -o, --output \u003coutput\u003e   Output directory\n  --version               Show the version.\n  --help                  Show help information.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeyz%2Fcomicsans","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkeyz%2Fcomicsans","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeyz%2Fcomicsans/lists"}