Giter VIP home page Giter VIP logo

runescape-text's Introduction

RuneScape Text

Convert text to a text image with RuneScape chat effects.

Selling rune scimmy 15k
More examples
92 is half of 99
Free armor trimming!
Fun things are fun.
The quick brown fox jumps over the lazy dog
Lorem ipsum

Getting started

npm i runescape-text

If you're on Windows and installation fails due to issues with canvas, follow the instructions at https://github.com/Automattic/node-canvas/wiki/Installation:-Windows to install the necessary dependencies. You can find installation instructions for other operating systems in the same wiki.

Examples

npx runescape-text "glow3:wave:hello world"
import { writeFileSync } from "node:fs";

import getRuneScapeText from "runescape-text";

const message = "glow3:wave:hello world";
const options = { debug: true };
const { data, extension } = getRuneScapeText(message, options);

writeFileSync(`./runescape-text.${extension}`, Buffer.from(data));

References

runescape-text's People

Contributors

dependabot[bot] avatar peterthehan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

broduer flyskywhy

runescape-text's Issues

Add config to handle casing

In rs, only the first letter in the string is capitalized, rest is lowercase. Should support this as a setting. Default to false.

Custom filename for CLI file output

Filename is hardcoded to runescape-text. It will overwrite any file named that which is negative for UX.
CLI should (any one or more should be good):

  1. Allow the user to enter their own filename
  2. Append a unique enough string to runescape-text to avoid filename collision
  3. Not allow overwriting to occur

Support browser env

Known issues:

  • Encoding a png buffer not using node-canvas' utility method fixed in 0fd59a5
  • Registering the font

Fix error after running npx: Error: EPERM: operation not permitted, unlink

Error output after running npx:

internal/fs/utils.js:307
    throw err;
    ^

Error: EPERM: operation not permitted, unlink 'C:\Users\Peter\AppData\Roaming\npm-cache\_npx\13284\node_modules\runescape-text\node_modules\canvas\build\Release\canvas.node'
    at Object.unlinkSync (fs.js:1210:3)
    at fixWinEPERMSync (C:\Program Files\nodejs\node_modules\npm\node_modules\rimraf\rimraf.js:219:13)
    at rimrafSync (C:\Program Files\nodejs\node_modules\npm\node_modules\rimraf\rimraf.js:319:28)
    at C:\Program Files\nodejs\node_modules\npm\node_modules\rimraf\rimraf.js:350:5 
    at Array.forEach (<anonymous>)
    at rmkidsSync (C:\Program Files\nodejs\node_modules\npm\node_modules\rimraf\rimraf.js:349:26)
    at rmdirSync (C:\Program Files\nodejs\node_modules\npm\node_modules\rimraf\rimraf.js:342:7)
    at fixWinEPERMSync (C:\Program Files\nodejs\node_modules\npm\node_modules\rimraf\rimraf.js:217:5)
    at rimrafSync (C:\Program Files\nodejs\node_modules\npm\node_modules\rimraf\rimraf.js:319:28)
    at C:\Program Files\nodejs\node_modules\npm\node_modules\rimraf\rimraf.js:350:5 
{
  errno: -4048,
  syscall: 'unlink',
  code: 'EPERM',
  path: 'C:\\Users\\Peter\\AppData\\Roaming\\npm-cache\\_npx\\13284\\node_modules\\runescape-text\\node_modules\\canvas\\build\\Release\\canvas.node'
}

Not sure what this is. Does not occur running locally node src/cli.js "my message"

runescape-text v1.1.2, Windows 10, node v14.15.4, npx 6.14.10

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.