Skip to content
/ zlogo Public

A tool using logo.svg and svglib to generate custom logo

License

Notifications You must be signed in to change notification settings

zjykzj/zlogo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Language: 🇺🇸 🇨🇳

«zlogo» combined with logo.svg and svglib, can generate custom logo images in PNG format

Implementation examples are as follows:

# generate logo `hahaha`
$ zlogo -l hahaha
# specifies that the font size is 100
$ zlogo -fs 100
# specifies that the surrounding blank fill size is 100
$ zlogo -p 100
# specify the output path
$ zlogo -o ./zlogo.svg
# specify the configuration file path
$ zlogo -c ~/zlogo/configs/readme.yaml

Table of Contents

Background

I want to design a personal logo. After find a lot of information, found that

  1. logo.svg can customize logo patterns and generate svg files
  2. svglib can convert svg to png

So i wrote this script for everyone's convenience

Install

$ pip install zlogo

Usage

$ zlogo --help
usage: zlogo [-h] [-l LOGO] [-f FONT] [-fs FontSize] [-p PADDING]
             [--color COLOR] [-c CONFIG_FILE] [-o OUTPUT] [-v]

custom logo - ZLOGO

optional arguments:
  -h, --help            show this help message and exit
  -l LOGO, --logo LOGO  specify the logo text
  -f FONT, --font FONT  path to a font file(.ttf)
  -fs FontSize, --fontsize FontSize
                        specify the font size
  -p PADDING, --padding PADDING
                        specify the border size
  --color COLOR         sepcify the text' color
  -c CONFIG_FILE, --config_file CONFIG_FILE
                        path to config file
  -o OUTPUT, --output OUTPUT
                        path to output file(.svg)
  -v, --version         output version infomation

It can be configured through command line parameters or through configuration files

  • For configuration files, please refer to avatar.yaml and readme.yaml in the configs directory
  • For font files
    1. If you specify with the parameter -f, you must specify the exact path
    2. If you use the configuration file to specify, you can put the font file in the ~/.fonts directory and specify the font file name in the configuration file

Note: the setting of command line parameters overwrites the configuration file

Maintainers

  • zhujian - Initial work - zjykzj

Thanks

Contributing

Anyone's participation is welcome! Open an issue or submit PRs.

Small note:

License

Apache License 2.0 © 2020 zjykzj

About

A tool using logo.svg and svglib to generate custom logo

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published