1.0.0 • Published 10 years ago

letter-bitmap v1.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
10 years ago

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.