Giter Site home page Giter Site logo

toastymallows / wordart-on-demand Goto Github PK

View Code? Open in Web Editor NEW
5.0 2.0 0.0 2 MB

Generate 90s MS Wordart from Node or Docker

CSS 51.67% HTML 0.18% JavaScript 9.07% Less 38.77% Dockerfile 0.30%
wordart 1990s msword image-generation puppeteer-screenshot png-generator docker-generator wordart-generator transparent-pngs

wordart-on-demand's Introduction

Wordart On Demand

A node script and docker container for generating transparent PNGs of 90s MS Wordart.

Built on css3wordart written by Ari Rizzitano. Inspired by pythonWordArt written by zorbaproject. Also inspired by https://makewordart.com going offline. I figured it's time for everyone to generate their own Wordart locally ๐Ÿ™‚
ย 

How It Works

The node script parses command line arguments and uses regex to replace text in a template HTML file that will render the wordart when loaded in a browser. Puppeteer is used to load a headless version of Google Chrome and take a screenshot of the page with a transparent background. That screenshot is then trimmed by GraphicsMagick and saved to an output directory.
ย 

Usage Info

Using Node

To Wordart PNGs using nodejs:

  1. Install nodejs and npm
  2. Install GraphicsMagick
  3. Clone the repo
  4. npm install
  5. npm test to see all design examples
  6. node .\wordartOnDemand.js -w "Hello World" -a rainbow to generate a specific wordart

See usage with --help (-h) to see all supported styles.

Using Docker

โš  Docker images are experimental. See the issues section for more information. It's best to use the NodeJS method for now.

If you don't want to install Node/NPM (or you like Docker better), you can generate Wordart PNGs using Docker. Note that this Docker image will take up ~1 GB, since it needs to download Chromium to render the image in a browser.

Docker Hub Image

You can utilize the prebuilt Docker image that is hosted on Docker Hub:

https://hub.docker.com/repository/docker/toastymallows/wordart-on-demand

docker run --rm -v ~/wordart/out:/wordart/out toastymallows/wordart-on-demand:latest -w "Hello World" -a rainbow

Your generated PNG should be located at /home/<user>/wordart/out (\\wsl$\<WSL 2 OS>\home\<wsl2 user>\wordart\out on Windows via WSL 2.)

Build Docker Image manually

If you'd prefer, you can build the Docker image manually.

Windows
  1. Install Docker
  2. Install and setup WSL 2
  3. Install a WSL 2 Linux OS in Windows (I chose Ubuntu 20.04.1 LTS)
  4. Open the WSL 2 command prompt
  5. cd /mnt/<repo clone directory>
  6. docker build -t wordart .
  7. docker run --rm -v ~/wordart/out:/wordart/out wordart:latest -w "Hello World" -a rainbow
  8. Your generated PNG should be located at \\wsl$\<WSL 2 OS>\home\<wsl2 user>\wordart\out (accessible from Windows Explorer)
Linux
  1. Install Docker
  2. docker build -t wordart .
  3. docker run --rm -v ~/wordart/out:/wordart/out wordart:latest -w "Hello World" -a rainbow
  4. Your generated PNG should be located at /home/<user>/wordart/out
Mac

Try it out and let me know! PRs welcome ๐Ÿ™‚

Issues

There are some issues with Docker images:

  • Impact font is not working, affecting some Wordart variations

For now, if you want accurate wordart, it's best to use the NodeJS approach.
ย 

TODO

  • Allow changing output directory via command line argument (when running from Node)
  • Allow making Wordart larger via command line argument

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.