Giter Club home page Giter Club logo

logo-canvas's Introduction

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.

logo-canvas's People

Contributors

drl990114 avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

coreymakes

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.