{"id":19273009,"url":"https://github.com/enzet/iconscript","last_synced_at":"2026-05-30T16:31:46.224Z","repository":{"id":58608542,"uuid":"529868823","full_name":"enzet/iconscript","owner":"enzet","description":"Generating icons using text commands","archived":false,"fork":false,"pushed_at":"2022-10-23T19:18:49.000Z","size":112,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-05T13:43:49.634Z","etag":null,"topics":["antlr","go","icons"],"latest_commit_sha":null,"homepage":"","language":"Go","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/enzet.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-08-28T13:21:52.000Z","updated_at":"2022-12-14T14:34:07.000Z","dependencies_parsed_at":"2023-01-20T12:20:44.034Z","dependency_job_id":null,"html_url":"https://github.com/enzet/iconscript","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/enzet%2Ficonscript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enzet%2Ficonscript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enzet%2Ficonscript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enzet%2Ficonscript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/enzet","download_url":"https://codeload.github.com/enzet/iconscript/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240378878,"owners_count":19792039,"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":["antlr","go","icons"],"created_at":"2024-11-09T20:40:00.807Z","updated_at":"2026-05-30T16:31:46.219Z","avatar_url":"https://github.com/enzet.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# iconscript\n\niconscript is a language for describing pixel-wise pictograms in the style of the [Röntgen](https://github.com/enzet/Roentgen) project.\n\nThe grammar of the language is described in the ANTLR4 `grammar/IconScript.g4` file.\n\n## SVG generation\n\nThere are two implementations of iconscript for parsing and generating SVG files.\n\n  *  **Rust**: `cargo install iconscript`. Rust implementation is *faster* and *more reliable*. It uses [`linesweeper`](https://docs.rs/linesweeper/latest/linesweeper/) library for Boolean path operations and SVG optimizations. \n  *  **JavaScript** (TypeScript): `npm install iconscript`. JavaScript implementation uses [Paper.js](http://paperjs.org/) library, that may produce wrong outputs. \n\n## Syntax\n\nSyntax slightly resembles the syntax of path commands in SVG. Positions on the plane are coded as two floating point number separated by comma: `\u003cx\u003e,\u003cy\u003e` or `+\u003cx\u003e,\u003cy\u003e`. `+` means that the position is relative to the `position`.\n\nIf current position is (5, 5), `+1,2` will give (6, 7) and update current position to (6, 7) as well.\n\n### Global context\n\n  * `position` — vector of two floats, current position of the cursor.\n  * `width` — float, stroke width.\n  * `fill` — Boolean, whether objects should be filled.\n\n### Commands\n\n| **Command** | **Description** |\n|---|---|\n| `subtract` | Set subtraction mode |\n| `fill` | Set fill mode |\n| `w \u003cfloat\u003e` | Set `width` to a value |\n| `m \u003cposition\u003e` | Set `position` to a value |\n| `l [\u003cposition\u003e]` | Draw lines between positions |\n| `e \u003cposition\u003e \u003cfloat\u003e` | Draw circle specified by center point and radius |\n| `r \u003cposition\u003e \u003cposition\u003e` | Draw rectangle specified by top left and bottom right points |\n| `a \u003cposition\u003e \u003cfloat\u003e \u003cfloat\u003e \u003cfloat\u003e` | Draw arc specified by center point, radius, and two angles in radians |\n### Variables\n\nVariables can be defined with `\u003cvariable\u003e = [\u003ccommand\u003e]` and accessed with `@\u003cvariable\u003e`.\n\n### Scopes\n\nScopes group commands together using `{` and `}`. They can be nested and are used to incapsulate context changes.\n\n### Example\n\n```iconscript\nsquare = fill r +0,0 +2,2\nicon glider = {\n    m 6,2   @square m +4,4 @square\n    m +-8,4 @square m +4,0 @square m +4,0 @square\n}\n```\n\nThis code defines a square (`lf`, filled line — polygon with 5 points). It then reuses `square` variable 5 times to draw a glider.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenzet%2Ficonscript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fenzet%2Ficonscript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenzet%2Ficonscript/lists"}