logo-canvas
v1.0.3
Published
[![LICENSE](https://img.shields.io/github/license/halodong/logo-canvas?style=flat-square)](./LICENSE) [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/halodong/logo-canvas) [
Downloads
7
Readme
logo-canvas
Quickly generate images from text based on canvas
. Supports command line interface and in-browser use.
Install
Use npm
$ npm install logo-canvas
Use
CLI
$ logo
exam1
{
"fontColor": "black",
"backgroundColor": "white",
"text": "S",
"shape": { "shape": "circle" },
"width": 128,
"height": 128,
"fontSize": 64,
"fontFamily": "Origami-Mommy"
}
exam2
{
"fontColor": "white",
"backgroundColor": "#C70039",
"text": "logo",
"width": 128,
"height": 64,
"fontSize": 32,
"fontFamily": "Blocked",
"shape": "rounded"
}
browser
<script src="https://ajax.googleapis.com/ajax/libs/webfont/1.6.26/webfont.js"></script>
<script>
WebFont.load({
google: {
families: ["Tangerine"]
},
active: function () {
const logo = new Logo({
canvas,
backgroundColor: 'blue',
text: 'canvas',
width: 200,
height: 90,
shape: "rounded",
fontColor: "white",
backgroundColor: "#C70039",
fontFamily: "Tangerine",
fontSize: 80
})
document.body.appendChild(logo.drawLogo())
}
});
</script>
Problem
For bugs or suggestions, you can submit via create an issue. © 2022 GitHub, Inc.