2.1.1 • Published 10 years ago

bmfont-lato v2.1.1

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

bmfont-lato

experimental

Lato packed as a BMFont JSON object, so it can be required for testing.

This also exports an images field, which is an array of ndpack-images parallel to the pages array.

var Lato = require('bmfont-lato')

//do something with the ndarrray image
var shape = Lato.images[0].shape.slice(0, 3))

//e.g. image shape is 512x512x4
console.log(shape)

//BMFont fields..
console.log(Lato.info)
console.log(Lato.chars)
console.log(Lato.kernings)

Since all glyphs have been packed into a single image, the paths and images array will have a length of 1.

The ndarray image contains 4 Lato Regular fonts packed with gdx-fontpack, each of which can be required separately:

  • require('bmfont-lato/16')
  • require('bmfont-lato/24')
  • require('bmfont-lato/32')
  • require('bmfont-lato/64')

The default exported font is 32 (the size is in px).

URI

You can also just grab the data URI like so:

  • require('bmfont-lato/image-uri')

Usage

NPM

Build

See package.json scripts on how to build. You need these tools:

npm install ndpack-image bmfont2json module-exports -g

Then:

#first you need to build an atlas with your tool of choice
# ...

#then pack it with ndpack-image
npm run pack

#then export all fonts as CommonJS
npm run fonts

License

MIT, see LICENSE.md for details.

2.1.1

10 years ago

2.1.0

10 years ago

2.0.0

11 years ago

1.0.1

11 years ago

1.0.0

11 years ago