Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

A simple tool to make images from a single character or in bulk from a template

License

NotificationsYou must be signed in to change notification settings

metaory/xico

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

simple cli to make png images from unicode characters

@1736000000


DESCRIPTION

xico is a simplesvg template.

Rendered with options from command-line or a template file.

It createspng images from thesvg

Thesvg contains only 2 elements

Most of their attributesrect attr andtext attr are added.

CheckCustom Attributes section for adding custom attributes.

SYNOPSIS

xico [OPTION]... CHR FILEpossible output FILE extension[svg,png,ps,eps,pdf,emf,wmf,xaml]

Options

CLI Only Options

These options are only available on CLI--export-filename Output file name

cli optionaliasdefault
--help-h
--size-s500
--template-t
--delay3
--no-delay

Options

These options are available in template and CLI

optionaliasdefault
delayd3
sizes500
backgroundxbgblack
background-opacityxbo0
rect optionaliasdefault
r_fillbgblack
r_widthw100
r_heighth100
r_opacityo0.5
r_rxr25
r_ryr25
r_x0
r_y0
text optionaliasdefault
t_fillfg#3311FF
t_stroke-colorstrokecyan
t_stroke-widthborder0
t_stroke-linecapround
t_stroke-linejoinround
t_font-familyffmonospace
t_font-weightfwbold
t_font-sizefs8em
t_rotate0
t_transformtranslate(0,0)
t_transform-origincenter
t_dx0
t_dy3.5
t_xx50
t_yy50

CLI Usage

Note

In command-line

long-options prefixed with double hyphen--aliases with single hyphen-

eg.t_font-size 9em or-fs 9em

eg.

xico --r_fill '#3300FF' λ

Or alias if available

xico -bg '#3300FF' ᮿ

Multi-Form Input

Accept various forms of input, such as stdin, local files & dirs, and remote URLs.

InputExample
CMD inputxico hello
Stdin pipecat data.txt | xico
Local filesxico -f data.txt
Local imagesxico -f image.png
Local directoriesxico -f dir/
Remote URLsxico -f https://example.com
Combine Inputsxico -f dir/ -f data.txt explain

Template Usage

All options or their alias can be set in a xico template

set,put,res andpre are the only commands

Note

template filename orextension can be anything

SET command
set <option> <value>

This will set or update the option

set commands can be repeated, the latest would take precedence.

# foo.xcset r_fill #3311FFset t_font-size 64px

Or aliasif available

set bg #3311FFset fs 10em

Set commands can be repeated, every set will overwrite the previous value

PUT command

put <char> <destination>

This will create an image from the<char> and place it<destination>with the current set options

Put commands can be repeated, every put will use the options set to that point

RES command

res

Or

reset

Will reset allset options, anyput afterwards would use the default options

PRE command

pre <path>

Anyput afterwards will output with this prefix.

EG.

# ...pre /tmp/foosetbg redput テ hoge.pngsetfg blueput た fuga.png# will create#/tmp/foo/hoge.png#/tmp/foo/fuga.pngpre$HOME/.config/awesome/layout/setfg#3311FFput ⬒  tiletop.pngput ◨  tileright.pngsetfg#AA44FFput ⬓  tilebottom.pngput ◧  tileleft.pngresput ⬓  with_default_option_tilebottom.pngput ◧  with_default_option_tileleft.png
eg. xico -bg red -fg '#3311ff' 󰘧 hello.png

💡 Check complete templatetemplates/default.xc

🐣 Check starter templatetemplates/starter.xc

Get Started

cp templates/starter.xc <path>xico -t <path>

Caution

The final positional arguments is required if no template is provided

Note

The output is always square

Set the output size withsize or its aliass

eg.size 700 ors 700would be a square 700x700px png

Important

size is integer without any unit,its always inpx

Note

The text is always centered

it can be adjusted witht_x, t_y, t_dx, t-dy

Note

The output is always full square on(0,0)

Note

the background default radius is25

set radius to50 for aperfect circleyou can set radius withr orr_rx andr_ry

Caution

options with special character need quoting

Note

Options can be used mixed togetheras command-line options or in template

Important

Options can be repeatedthe final one takes precedence.


EXAMPLES

# convert one characterxico 𝝺 lambda.png# create png from character with rounded cover, custom fg and bg, font sizexico -bg '#112233' -fg '#4411ff' -fs 4em 𝝺 ~/pics/x1.png# create a new image from character with custom color, transparent background and default configxico -fg '#AA1144' ✪  ~/pics/x2.png# process a template file# xico -t awesome-xico.xc

Custom Attributes

To add other attributes add an entry To add theXC associative array.Prefixr_ for<rect> element andt_ for<text> element

Almost allPresentation attributes should work

For<rect>[r_<attribute>]=<default>

For<text>[t_<attribute>]=<default>

eg.

[t_writing-mode]=vertical-lr[r_stroke-miterlimit]=214

The SVG template

Is a simple SVG file placed inlib/xico.svg can easily be extended.


Requirements


Installation

  • clone repo
  • give execution permissions
  • place it in your path
# Clone the repogitclonegit@github.com:metaory/xico.git# Navigate to repocdxico# Give execution permissionschmod+xxico# Link it somewhere in your PATHln-svf $PWD/xico/usr/bin/xico# Use it anywherexico 𐰒zig.pngxico-bg'#112222'-fg'#AA11FF'-r50 𝝺 lambda.png# Usagexico--help

TODO

  • Dynamic readme usage
  • Dynamic cli usage
  • Dynamic attributes
  • Reset opts action
  • Template
  • Attributes; bg, fg, font, size
Fallback rendering engines

ENVIRONMENT VARIABLES

# XICO_SILENT    | less verbose# XICO_DEBUG     | debug mode

SEE ALSO

inkscape(1)

AUTHOR

metaory <metaory@gmail.com>, Apr 2024

▀▄▀ █ █▀▀ █▀██░█ █ █▄▄ █▄█▁▁▁▁▁▁▁▁v0.7▁

License

MIT


[8]ページ先頭

©2009-2025 Movatter.jp