logo-canvas
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

LICENSE js-standard-style NPM Version Build Status

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

exam1.png

{
  "fontColor": "black",
  "backgroundColor": "white",
  "text": "S",
  "shape": { "shape": "circle" },
  "width": 128,
  "height": 128,
  "fontSize": 64,
  "fontFamily": "Origami-Mommy"
}

exam2

exam2.png

{
  "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.

Readme

Keywords

Package Sidebar

Install

npm i logo-canvas

Weekly Downloads

2

Version

1.0.3

License

MIT

Unpacked Size

289 kB

Total Files

25

Last publish

Collaborators

  • ruilindong