{"id":13540037,"url":"https://github.com/metaory/xico","last_synced_at":"2025-03-29T21:25:08.142Z","repository":{"id":231558007,"uuid":"781616596","full_name":"metaory/xico","owner":"metaory","description":"🚧 xico - make images from unicode characters or user custom config","archived":false,"fork":false,"pushed_at":"2024-04-13T22:56:45.000Z","size":33,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-04-14T12:27:01.873Z","etag":null,"topics":["cli","command-line","font-glyph","font-glyphs","icon-gen","icon-generation","icon-generator","svg","svg-cli","svg-font","svg-generator","svg-icon","svg-icons"],"latest_commit_sha":null,"homepage":"https://github.com/metaory/xico","language":"Shell","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/metaory.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-04-03T18:10:01.000Z","updated_at":"2024-05-21T07:57:02.894Z","dependencies_parsed_at":"2024-05-21T08:07:08.161Z","dependency_job_id":null,"html_url":"https://github.com/metaory/xico","commit_stats":null,"previous_names":["metaory/xico"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metaory%2Fxico","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metaory%2Fxico/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metaory%2Fxico/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metaory%2Fxico/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/metaory","download_url":"https://codeload.github.com/metaory/xico/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246245278,"owners_count":20746615,"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":["cli","command-line","font-glyph","font-glyphs","icon-gen","icon-generation","icon-generator","svg","svg-cli","svg-font","svg-generator","svg-icon","svg-icons"],"created_at":"2024-08-01T09:01:38.211Z","updated_at":"2025-03-29T21:25:08.118Z","avatar_url":"https://github.com/metaory.png","language":"Shell","funding_links":[],"categories":["XC"],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003ch1\u003e𐆖𖭐ꛕ𐊔\u003c/h1\u003e\n  \u003cimg src=\".github/assets/xico.png\" width=\"168px\"/\u003e\n  \u003ch4\u003esimple cli to make png images from unicode characters\u003c/h4\u003e\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n    \u003cimg src=\"https://raw.githubusercontent.com/metaory/metaory/refs/heads/master/.github/xico_f/README.png\" /\u003e\n    \u003cp\u003e\u003ccode\u003e@1736000000\u003c/code\u003e\u003c/p\u003e\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\".github/assets/x01.png\" width=\"96\" /\u003e\n  \u003cimg src=\".github/assets/x02.png\" width=\"96\" /\u003e\n  \u003cimg src=\".github/assets/x03.png\" width=\"96\" /\u003e\n  \u003cimg src=\".github/assets/x04.png\" width=\"96\" /\u003e\n  \u003cimg src=\".github/assets/x05.png\" width=\"96\" /\u003e\n  \u003cimg src=\".github/assets/x06.png\" width=\"96\" /\u003e\n  \u003cimg src=\".github/assets/x07.png\" width=\"96\" /\u003e\n  \u003cimg src=\".github/assets/x08.png\" width=\"96\" /\u003e\n  \u003cimg src=\".github/assets/x09.png\" width=\"96\" /\u003e\n  \u003cimg src=\".github/assets/x10.png\" width=\"96\" /\u003e\n  \u003cimg src=\".github/assets/x11.png\" width=\"96\" /\u003e\n  \u003cimg src=\".github/assets/x12.png\" width=\"96\" /\u003e\n  \u003cimg src=\".github/assets/x13.png\" width=\"96\" /\u003e\n  \u003cimg src=\".github/assets/x14.png\" width=\"96\" /\u003e\n  \u003cimg src=\".github/assets/x15.png\" width=\"96\" /\u003e\n  \u003cimg src=\".github/assets/x16.png\" width=\"96\" /\u003e\n  \u003c!-- \u003cimg src=\".github/assets/x17.png\" width=\"96\" /\u003e --\u003e\n  \u003cimg src=\".github/assets/x18.png\" width=\"96\" /\u003e\n\u003c/div\u003e\n\n---\n\n## DESCRIPTION\n\n`xico` is a simple `svg` template.\n\nRendered with options from command-line or a template file.\n\nIt creates `png` images from the `svg`\n\nThe `svg` contains only 2 elements\n- `\u003crect\u003e` [SVG/Element/rect](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/rect)\n- `\u003ctext\u003e` [SVG/Element/text](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/text)\n\nMost of their attributes [rect attr](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/rect#attributes) and [text attr](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/text#attributes) are added.\n\nCheck [Custom Attributes](#custom-attributes) section for adding custom attributes.\n\n## SYNOPSIS\n\n\txico [OPTION]... CHR FILE\n\n\tpossible output FILE extension[svg,png,ps,eps,pdf,emf,wmf,xaml]\n\n## Options\n\n### CLI Only Options\n\nThese options are only available on CLI\n --export-filename  Output file name\n\n\n| cli option | alias | default |\n| ---------- | ----- | ------- |\n| --help     | -h    |         |\n| --size     | -s    | 500     |\n| --template | -t    |         |\n| --delay    |       | 3       |\n| --no-delay |       |         |\n\n### Options\n\nThese options are available in template and CLI\n\n| option             | alias | default |\n| -------------------| ----- | ------- |\n| delay              | d     | 3       |\n| size               | s     | 500     |\n| background         | xbg   | black   |\n| background-opacity | xbo   | 0       |\n\n| rect option  | alias | default |\n| ------------ | ----- | ------- |\n| r_fill       | bg    | black   |\n| r_width      | w     | 100     |\n| r_height     | h     | 100     |\n| r_opacity    | o     | 0.5     |\n| r_rx         | r     | 25      |\n| r_ry         | r     | 25      |\n| r_x          |       | 0       |\n| r_y          |       | 0       |\n\n| text option        | alias  | default        |\n| ------------------ | ------ | -------------- |\n| t_fill             | fg     | #3311FF        |\n| t_stroke-color     | stroke | cyan           |\n| t_stroke-width     | border | 0              |\n| t_stroke-linecap   |        | round          |\n| t_stroke-linejoin  |        | round          |\n| t_font-family      | ff     | monospace      |\n| t_font-weight      | fw     | bold           |\n| t_font-size        | fs     | 8em            |\n| t_rotate           |        | 0              |\n| t_transform        |        | translate(0,0) |\n| t_transform-origin |        | center         |\n| t_dx               |        | 0              |\n| t_dy               |        | 3.5            |\n| t_x                | x      | 50             |\n| t_y                | y      | 50             |\n\n\n#### CLI Usage\n\n\u003e [!NOTE]\n\u003e In command-line\n\u003e\n\u003e long-options prefixed with double hyphen `--`\n\u003e aliases with single hyphen `-`\n\u003e\n\u003e eg. `t_font-size 9em` or `-fs 9em`\n\neg.\n\n\txico --r_fill '#3300FF' λ\n\nOr alias if available\n\n\txico -bg '#3300FF' ᮿ\n\n\u003c!-- https://github.com/sigoden/aichat/blob/main/README.md?plain=1#L43 --\u003e\n\n### Multi-Form Input\n\nAccept various forms of input, such as stdin, local files \u0026 dirs, and remote URLs.\n\n| Input             | Example                              |\n| ----------------- | ------------------------------------ |\n| CMD input         | `xico hello`                       |\n| Stdin pipe        | `cat data.txt \\| xico`             |\n| Local files       | `xico -f data.txt`                 |\n| Local images      | `xico -f image.png`                |\n| Local directories | `xico -f dir/`                     |\n| Remote URLs       | `xico -f https://example.com`      |\n| Combine Inputs    | `xico -f dir/ -f data.txt explain` |\n\n\n#### Template Usage\n\nAll options or their alias can be set in a xico template\n\n`set`, `put`, `res` and `pre` are the only commands\n\n\u003e [!NOTE]\n\u003e `template` file **name** or **extension** can be anything\n\n##### SET command\n\n\tset \u003coption\u003e \u003cvalue\u003e\n\nThis will set or update the option\n\n`set` commands can be repeated, the latest would take precedence.\n\n\n\t# foo.xc\n\n\tset r_fill #3311FF\n\tset t_font-size 64px\n\n\nOr alias _if available_\n\n\tset bg #3311FF\n\tset fs 10em\n\nSet commands can be repeated, every set will overwrite the previous value\n\n##### PUT command\n\n`put \u003cchar\u003e \u003cdestination\u003e`\n\nThis will create an image from the `\u003cchar\u003e` and place it `\u003cdestination\u003e`\nwith the current set options\n\nPut commands can be repeated, every put will use the options set to that point\n\n##### RES command\n\n`res`\n\nOr\n\n`reset`\n\nWill reset all `set` options, any `put` afterwards would use the default options\n\n##### PRE command\n\n`pre \u003cpath\u003e`\n\nAny `put` afterwards will output with this prefix.\n\nEG.\n\n```sh\n# ...\npre /tmp/foo\n\nset bg red\nput テ hoge.png\n\nset fg blue\nput た fuga.png\n\n# will create\n#\t/tmp/foo/hoge.png\n#\t/tmp/foo/fuga.png\n\npre $HOME/.config/awesome/layout/\n\nset fg #3311FF\n\nput ⬒  tiletop.png\nput ◨  tileright.png\n\nset fg #AA44FF\n\nput ⬓  tilebottom.png\nput ◧  tileleft.png\n\nres\n\nput ⬓  with_default_option_tilebottom.png\nput ◧  with_default_option_tileleft.png\n```\n\n\teg. xico -bg red -fg '#3311ff' 󰘧 hello.png\n\n\n#### 💡 Check complete template [templates/default.xc](templates/default.xc)\n\n#### 🐣 Check starter template [templates/starter.xc](templates/starter.xc)\n\n## Get Started\n\n```\ncp templates/starter.xc \u003cpath\u003e\nxico -t \u003cpath\u003e\n```\n\n---\n\n\u003e [!CAUTION]\n\u003e The final positional arguments is required if no template is provided\n\n\u003e [!NOTE]\n\u003e The output is always square\n\u003e\n\u003e Set the output size with `size` or its alias `s`\n\u003e\n\u003e eg. `size 700` or `s 700`\n\u003e would be a square 700x700px png\n\n\u003e [!IMPORTANT]\n\u003e `size` is integer without any unit, _its always in `px`_\n\n\u003e [!NOTE]\n\u003e The text is always centered\n\u003e\n\u003e it can be adjusted with `t_x, t_y, t_dx, t-dy`\n\n\u003e [!NOTE]\n\u003e The output is always full square on `(0,0)`\n\n\u003e [!NOTE]\n\u003e the background \u003crect\u003e default radius is `25`\n\u003e\n\u003e set radius to `50` for a **perfect circle**\n\u003e you can set radius with `r` or `r_rx` and `r_ry`\n\n\u003e [!CAUTION]\n\u003e options with special character need quoting\n\n\u003e [!NOTE]\n\u003e Options can be used mixed together\n\u003e as command-line options or in template\n\n\u003e [!IMPORTANT]\n\u003e Options can be repeated\n\u003e the final one takes precedence.\n\n---\n\n### EXAMPLES\n\n\t# convert one character\n\txico 𝝺 lambda.png\n\n\t# create png from character with rounded cover, custom fg and bg, font size\n\txico -bg '#112233' -fg '#4411ff' -fs 4em 𝝺 ~/pics/x1.png\n\n\t# create a new image from character with custom color, transparent background and default config\n\txico -fg '#AA1144' ✪  ~/pics/x2.png\n\n\t# process a template file\n\t# xico -t awesome-xico.xc\n\n---\n\n### Custom Attributes\n\nTo add other attributes add an entry To add the `XC` associative array.\nPrefix `r_` for `\u003crect\u003e` element and `t_` for `\u003ctext\u003e` element\n\nAlmost all [Presentation attributes](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute#presentation_attributes) should work\n\nFor `\u003crect\u003e` `[r_\u003cattribute\u003e]=\u003cdefault\u003e`\n\nFor `\u003ctext\u003e` `[t_\u003cattribute\u003e]=\u003cdefault\u003e`\n\neg.\n```sh\n[t_writing-mode]=vertical-lr\n\n[r_stroke-miterlimit]=214\n```\n\n### The SVG template\n\nIs a simple SVG file placed in [lib/xico.svg](lib/xico.svg) can easily be extended.\n\n---\n\nRequirements\n------------\n\n- [Inkscape](https://gitlab.com/inkscape/inkscape)\n\n---\n\n\nInstallation\n------------\n\n- clone repo\n- give execution permissions\n- place it in your path\n\n```ex\n# Clone the repo\ngit clone git@github.com:metaory/xico.git\n\n# Navigate to repo\ncd xico\n\n# Give execution permissions\nchmod +x xico\n\n# Link it somewhere in your PATH\nln -svf $PWD/xico /usr/bin/xico\n\n# Use it anywhere\nxico 𐰒 zig.png\n\nxico -bg '#112222'-fg '#AA11FF' -r 50 𝝺 lambda.png\n\n# Usage\nxico --help\n```\n\nTODO\n====\n- [ ] Dynamic readme usage\n- [ ] Dynamic cli usage\n- [X] Dynamic attributes\n- [X] Reset opts action\n- [X] Template\n- [x] Attributes; bg, fg, font, size\n\n##### Fallback rendering engines\n\n- [.] [ImageMagick](https://www.imagemagick.org) _cairo_\n- [.] [libvips](https://github.com/libvips/libvips) _cairo_\n- [.] [librsvg](https://wiki.gnome.org/projects/librsvg) _cairo_\n\n- [ ] Handle env settings\n- [ ] Handle stdin\n- [ ] Makefile\n\n---\n\n\n## ENVIRONMENT VARIABLES\n\n\t# XICO_SILENT    | less verbose\n\t# XICO_DEBUG     | debug mode\n\n\n## SEE ALSO\n\tinkscape(1)\n\n\n## AUTHOR\n\tmetaory \u003cmetaory@gmail.com\u003e, Apr 2024\n\n---\n\n\n\t▀▄▀ █ █▀▀ █▀█\n\t█░█ █ █▄▄ █▄█\n\t▁▁▁▁▁▁▁▁v0.7▁\n\n\n---\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetaory%2Fxico","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmetaory%2Fxico","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetaory%2Fxico/lists"}