CLI for rendering text with headless chrome.
This CLI is also available as a library.
ImageMagick is the traditional unix tool to programatically render text, and while it works very well for simple use cases, trying to use it to render rich text or html is very difficult. Pango is another option that's been around for ages, but both suffer from archaic syntax and minimal rich text support.
Puppeteer, on the other hand, allows for robust, headless chrome screenshots with best-in-class support for all modern html / text / font features.
This CLI makes it easy to use headless chrome to render text + html to images.
- built-in fontfaceobserver
- easily load google fonts
- optional word-wrap
- main content is just html
- styling is done via css
- handles multiple fonts
- thoroughly tested
- includes a CLI
npm install -g puppeteer-render-text-cli
Usage: puppeteer-render-text [options] <text>Options:-V, --version output the version number-o, --output <path> path of image file to store result-w, --width <number> optional max width-h, --height <number> optional max height-g, --load-google-font load font families from google-l, --load-font-family <string> font family to load with fontfaceobserver-s, --style <string> JSON string of CSS styles
- puppeteer-render-text - Library for this CLI.
- puppeteer - Headless Chrome Node API.
- awesome-puppeteer - Curated list of awesome puppeteer resources.
MIT © Travis Fischer