bmfont-lato
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 = //do something with the ndarrray imagevar shape = Latoimages0shape) //e.g. image shape is 512x512x4console //BMFont fields..consoleconsoleconsole
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
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.