{"id":17912711,"url":"https://github.com/stypox/text-to-gcode","last_synced_at":"2025-04-03T07:14:08.494Z","repository":{"id":128744439,"uuid":"168544605","full_name":"Stypox/text-to-gcode","owner":"Stypox","description":"Compiles ASCII text into 2D gcode that can be printed by a plotter","archived":false,"fork":false,"pushed_at":"2021-06-19T17:50:28.000Z","size":463,"stargazers_count":28,"open_issues_count":0,"forks_count":8,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-08T20:47:33.444Z","etag":null,"topics":["gcode","gcode-generation","text-to-gcode"],"latest_commit_sha":null,"homepage":"","language":"nesC","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Stypox.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2019-01-31T15:07:57.000Z","updated_at":"2025-02-01T22:49:08.000Z","dependencies_parsed_at":"2023-10-02T03:15:15.926Z","dependency_job_id":null,"html_url":"https://github.com/Stypox/text-to-gcode","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Stypox%2Ftext-to-gcode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Stypox%2Ftext-to-gcode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Stypox%2Ftext-to-gcode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Stypox%2Ftext-to-gcode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Stypox","download_url":"https://codeload.github.com/Stypox/text-to-gcode/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246952278,"owners_count":20859812,"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":["gcode","gcode-generation","text-to-gcode"],"created_at":"2024-10-28T19:46:40.327Z","updated_at":"2025-04-03T07:14:08.477Z","avatar_url":"https://github.com/Stypox.png","language":"nesC","readme":"# Text to G-code compiler\n\nThis repository contains a Python 3 script that takes a **text file as input** and generates a **2D G-code file as output**. The alphabet contained in the `ascii_gcode` subfolder supports **all ASCII characters** and is used by default, producing letters made up of just **single lines**, like you can see in the image below. The parameters that you can tune are the directory in which to look for the G-code alphabet, the maximum length of a line, the distance between two subsequent lines and the empty space between characters. You can then **use the produced G-code in a 2D plotter**, you may find this other project of mine useful: [plotter](https://github.com/Stypox/plotter).\n\n![An example with Lorem Ipsum and all supported characters](./example.png)\n\u003csup\u003eObtained with http://jherrm.com/gcode-viewer/\u003c/sup\u003e\n\n## Usage\n\nYou can run the script normally with [Python 3](https://www.python.org/downloads/):\n```\npython3 text_to_gcode.py ARGUMENTS...\n```\nThis is the help screen with all valid arguments (obtainable with `python3 text_to_gcode.py --help`):\n```\nusage: text_to_gcode.py [-h] [-i FILE] -o FILE [-g DIR] -l LINE_LENGTH [-s LINE_SPACING] [-p PADDING]\n\nCompiles text into 2D gcode for plotters\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -i FILE, --input FILE\n                        File to read characters from\n  -o FILE, --output FILE\n                        File in which to save the gcode result\n  -g DIR, --gcode-directory DIR\n                        Directory containing the gcode information for all used characters\n  -l LINE_LENGTH, --line-length LINE_LENGTH\n                        Maximum length of a line\n  -s LINE_SPACING, --line-spacing LINE_SPACING\n                        Distance between two subsequent lines\n  -p PADDING, --padding PADDING\n                        Empty space between characters\n```\n\nThe required parameters are the input, the output and the line length (in order to tune this last parameter, note that the average width of a character is ~4.5).\n\nAn example of command is:\n```sh\npython3 --input input.txt --output output.nc --line-length 300 --line-spacing 10 --padding 3\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstypox%2Ftext-to-gcode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstypox%2Ftext-to-gcode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstypox%2Ftext-to-gcode/lists"}