Home

Awesome

svgembed

SVG embedder for https://github.com/marionebl/svg-term

Installing

npm install -g git+https://github.com/miraclx/svgembed

# alternatively, with yarn
yarn global add https://github.com/miraclx/svgembed.git

Features

Caveats

Since this script just embeds the files you give it along with some SVG patches, the filesize is incremental and can be really large in some cases. Try using lightweight versions of fonts you embed. Or create custom fonts with the glyphs you need.

Depending on your browser and internet connection, the fonts might take a little while to load.

Usage

$ svgembed --help

svgembed (c) 2020 Miraculous Owonubi <omiraculous@gmail.com>
------------------------------------------------------------
Usage: svgembed [options]

Options
  -i, --input <VALUE>  the input SVG file
  -o, --output <VALUE> the output file name
  -f, --font <VALUE>   fontfile to be embedded (otf/ttf)
  -t, --title [VALUE]  set terminal window title (default: "Terminal")
  -r, --right          use right-sided window icons
  -v, --hover          dim window icons on hover
  --overwrite          overwrite existing output
  --h, --help          output usage information

Screenshots

Original SVG from svg-term

svg-term --in media/demo --out demo.svg --window --term konsole --width 78

Screenshot of original output from svg-term

Processed

svgembed -i demo.svg -o final.svg -r -f nerd_fonts.ttf -t "svgembed is cool" --hover

Screenshot of embedded fonts

Window icon dim on hover -v, --hover

Screenshot of embedded fonts

Library API

config: <object>

embedFont

insertTitleAndPositionIcons

License

Apache 2.0 © Miraculous Owonubi (@miraclx) <omiraculous@gmail.com>