{"id":27055115,"url":"https://github.com/cadin/plotter-text","last_synced_at":"2025-08-01T06:02:40.930Z","repository":{"id":215015538,"uuid":"735739948","full_name":"cadin/plotter-text","owner":"cadin","description":"Monoline SVG text system for Processing","archived":false,"fork":false,"pushed_at":"2024-12-07T20:23:06.000Z","size":514,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-07T21:20:20.640Z","etag":null,"topics":["creative-coding","plotter-art","processing"],"latest_commit_sha":null,"homepage":"","language":"Processing","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cadin.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}},"created_at":"2023-12-26T01:41:27.000Z","updated_at":"2024-12-07T20:23:10.000Z","dependencies_parsed_at":"2024-01-02T01:25:56.255Z","dependency_job_id":"f9cb2619-cc29-4eb5-8a41-249cb055c2f7","html_url":"https://github.com/cadin/plotter-text","commit_stats":null,"previous_names":["cadin/plotter-text"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cadin%2Fplotter-text","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cadin%2Fplotter-text/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cadin%2Fplotter-text/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cadin%2Fplotter-text/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cadin","download_url":"https://codeload.github.com/cadin/plotter-text/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247312276,"owners_count":20918401,"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":["creative-coding","plotter-art","processing"],"created_at":"2025-04-05T09:18:58.778Z","updated_at":"2025-04-05T09:18:59.313Z","avatar_url":"https://github.com/cadin.png","language":"Processing","readme":"# plotter-text\n\nGenerate dynamic single-stroke text in Processing. Save to SVG for clean pen plotter input.\n\n![banner](banner.jpg)\n\n## Getting Started\n\n### 📺 [Video Walkthrough](https://youtu.be/gfdROgQhm8M)\n\n### Requirements\n\n-   [Processing 4](https://processing.org/download/)\n-   The [ControlP5](https://github.com/sojamo/controlp5) library is required to run the Font Editor sketch.\n\n### Installation\n\n**1. Add the PlotterText class to your project**\n\nCopy the `PlotterText.pde` file from the [`dist`](dist/) folder into the folder for your Processing sketch.\n\n**2. Add the font files**\n\nCopy the entire [`astroTown`](fonts/astroTown/) font folder into your sketch's `data` folder.\n\nIf you want to create your own font, you'll need an SVG file for each character and a `data.json` file to specify font coordinates. Use the [Font Editor](examples/FontEditor/) in the [`examples`](examples/) folder to edit character positions and kerning pairs.\n\n### Example Sketch\n\n1. Create an instance of the `PlotterText` class with the path to your font.\n2. Use `drawText()` or `drawTextCentered()` to render text to the screen.\n\n```java\nPlotterText pt;\n\nvoid setup() {\n\tsize(300, 200);\n\tpt = new PlotterText(\"fonts/astroTown/\", 20);\n}\n\nvoid draw() {\n\tbackground(255);\n\tpt.drawText(\"Hello world!\", 10, 10);\n}\n\n```\n\n## Usage\n\n### Instantiation\n\n_PlotterText_ **new PlotterText**( _String_ fontPath, [ _float_ size ] )\n\nCreate an instance of the PlotterText class.  \n`fontPath` specifies the location of your font's folder (relative to your sketch's `data` folder).\n`size` is the desired display size in pixels.\n\n### Drawing Text\n\n_void_ **drawText**( _String_ text, [ _float_ x, _float_ y ] )\n\nDraw text to the screen.  \n`x` and `y` specify the position of the top left of the text.\n\n_void_ **drawTextCentered**( _String_ text, [[ _float_ x, _float_ y ], _float_ w ])\n\nDraw text to the screen, horizontally centered.\n`x` and `y` specify the position of the top center of the text.\n`w` specifies the width at which the text wraps to a new line.\n\n### Font Properties\n\n_float_ **letterSpacing**\n\nThe amount of additional space to add between each letter.  \nExpressed as a percentage of the character size.\n\n_float_ **lineHeight**\n\nThe amount of vertical space given to each line in multiline text.  \nExpressed as a percentage of the character size.\n\n_float_ **spaceWidth**\n\nThe width of a space character.  \nExpressed as a percentage of the character size.\n\n_void_ **setSize**( _float_ size )\n\nSet the display height of your font. Change this in between calls to `drawText` to create text of different sizes.\n\n### Utility\n\n_float_ **getStringWidth**( _String_ text )\n\nCalculate the width of a string using your font at its current size without drawing to the screen.\n\n### Modify and Save\n\nAdditional methods are available to modify font data and save it to disk.  \nCheck [`PlotterText.pde`](src/PlotterText.pde) for details.\n\n## Saving to SVG\n\nThe SVG library makes it possible to write SVG files directly from Processing.\nAny PlotterText drawn to the screen while saving will be added to the exported SVG.\n\n### Example sketch:\n\n```java\nimport processing.svg.*;\n\nPlotterText pt;\n\nvoid setup() {\n\tsize(400, 400);\n\tpt = new PlotterText(\"fonts/astroTown\", 12);\n\tnoLoop();\n}\n\nvoid draw() {\n\tbeginRecord(SVG, \"filename.svg\");\n\n\t// draw some text\n\tpt.drawText(\"Hello world\", 10, 10);\n\n\t// other vector drawing\n\tline(0, 0, width/2, height);\n\n\tendRecord();\n}\n```\n\nFor more examples, see the [SVG Export](https://processing.org/reference/libraries/svg/index.html) page on the Processing site.\n\n## Build from Source\n\nThe build script for this project (`build.sh`) simply copies the classes from `src` into a single file in the `dist` folder.\n\n```zsh\ncd [plotter-text]\n./build.sh\n```\n\n## Support\n\nThis is a personal project and is mostly unsupported, but I'm happy to hear feedback or answer questions.\n\n## License\n\nThis project is licensed under the Unlicense - see the [LICENSE](LICENSE) file for details.\n\n---\n\n👨🏻‍🦲❤️🛠\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcadin%2Fplotter-text","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcadin%2Fplotter-text","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcadin%2Fplotter-text/lists"}