Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/drl990114/logo-canvas
Quickly generate images from text based on canvas. Supports command line interface and in-browser use.
https://github.com/drl990114/logo-canvas
avatar canvas cli logo
Last synced: 11 days ago
JSON representation
Quickly generate images from text based on canvas. Supports command line interface and in-browser use.
- Host: GitHub
- URL: https://github.com/drl990114/logo-canvas
- Owner: drl990114
- License: mit
- Created: 2022-01-30T06:52:38.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-05-25T10:52:34.000Z (over 2 years ago)
- Last Synced: 2024-10-30T11:09:11.537Z (14 days ago)
- Topics: avatar, canvas, cli, logo
- Language: TypeScript
- Homepage:
- Size: 375 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README-cn.md
- License: LICENSE
Awesome Lists containing this project
README
[![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)
[![NPM Version](https://img.shields.io/npm/v/logo-canvas.svg)](npm-url)
[![Build Status](https://app.travis-ci.com/halodong/logo-canvas.svg?branch=main)](https://www.travis-ci.com)[npm-url]: https://npmjs.org/package/logo-canvas
# logo-canvas
基于 `canvas` 根据文字快速生成图片,支持命令行界面和浏览器内使用。[English](https://github.com/halodong/logo-canvas/blob/main/README.md)
## Install
Use npm
```
$ npm install logo-canvas
```## Use
### CLI
```
$ logo
```
#### exam1
![exam1.png](./examples/exam1.png)
```json
{
"fontColor": "black",
"backgroundColor": "white",
"text": "S",
"shape": { "shape": "circle" },
"width": 128,
"height": 128,
"fontSize": 64,
"fontFamily": "Origami-Mommy"
}
```
#### exam2
![exam2.png](./examples/exam2.png)
```json
{
"fontColor": "white",
"backgroundColor": "#C70039",
"text": "logo",
"width": 128,
"height": 64,
"fontSize": 32,
"fontFamily": "Blocked",
"shape": "rounded"
}```
### browser
- [browser](./examples/default.html)
```jsWebFont.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())
}
});```
## Problem
bug 或者建议,你可以通过 [create an issue](https://github.com/halodong/logo-canvas/issues/new) 提交.
© 2022 GitHub, Inc.