letter-bitmap

1.0.0 • Public • Published

letter-bitmap stable

Generate a single-channel bitmap for an individual character of a given font.

Usage

NPM

data = letter(char, font, size, [context])

Returns a 2D Float32Array containing the font data, on a scale from 0 (empty) to 255 (solid).

  • char is the character you want to render.
  • font is the font family you'd like to use.
  • size is the total width/height of the canvas, in pixels. The final data length will be size * size.
  • context is an optional 2D canvas context to use. Note that this will mess with the canvas itself.

letter-bitmap

License

MIT. See LICENSE.md for details.

Package Sidebar

Install

npm i letter-bitmap

Weekly Downloads

0

Version

1.0.0

License

MIT

Last publish

Collaborators

  • hughsk