New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

text2matrix

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

text2matrix

Convert text strings into customizable pixel matrices with options for max height, letter spacing, and more. Ideal for LED displays and creative typographic applications.

latest
Source
npmnpm
Version
2.0.0
Version published
Weekly downloads
2
100%
Maintainers
1
Weekly downloads
 
Created
Source

Text2Matrix

Introduction

Convert text strings into customizable pixel matrices with options for max height, letter spacing, and more. Ideal for LED displays and creative typographic applications.

Installation

npm install text2matrix

Usage

const { Font, Text } = require("text2matrix");

async function main() {
  const text = "Hello World!";
  const myFont = "myFont.ttf";
  const font = await Font.fromPath(myFont);
  const text = new Text(text, font, { fontSize: 16 });
  text.draw(); // only node environment, creates a png file
  const matrix = text.matrix; // returns a 2D array of grayscale values between 0 and 1
}

Keywords

pixel

FAQs

Package last updated on 13 Nov 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts