parse-bmfont-ascii

WebJar for parse-bmfont-ascii

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

parse-bmfont-ascii
Last Version

Last Version

1.0.6
Release Date

Release Date

Type

Type

jar
Description

Description

parse-bmfont-ascii
WebJar for parse-bmfont-ascii
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/mattdesl/parse-bmfont-ascii

Download parse-bmfont-ascii

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/parse-bmfont-ascii/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>parse-bmfont-ascii</artifactId>
    <version>1.0.6</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/parse-bmfont-ascii/
implementation 'org.webjars.npm:parse-bmfont-ascii:1.0.6'
// https://jarcasting.com/artifacts/org.webjars.npm/parse-bmfont-ascii/
implementation ("org.webjars.npm:parse-bmfont-ascii:1.0.6")
'org.webjars.npm:parse-bmfont-ascii:jar:1.0.6'
<dependency org="org.webjars.npm" name="parse-bmfont-ascii" rev="1.0.6">
  <artifact name="parse-bmfont-ascii" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='parse-bmfont-ascii', version='1.0.6')
)
libraryDependencies += "org.webjars.npm" % "parse-bmfont-ascii" % "1.0.6"
[org.webjars.npm/parse-bmfont-ascii "1.0.6"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

parse-bmfont-ascii

stable

Parses ASCII (text) BMFont files.

Takes a string or Buffer:

var fs = require('fs')
var parse = require('parse-bmfont-xml')

fs.readFileSync(__dirname+'/Arial.fnt', function(err, data) {
  var result = parse(data)
  console.log(result.info.face)   // "Arial"
  console.log(result.pages)       // [ 'sheet0.png' ]
  console.log(result.chars)       // [ ... char data ... ]
  console.log(result.kernings)    // [ ... kernings data ... ]
})

The spec for the returned JSON object is here. The input data should match the spec, see [test/Nexa Light-32.fnt](test/Nexa Light-32.fnt) for an example.

See Also

See text-modules for related modules.

Usage

NPM

result = parse(data)

Parses data, a string or Buffer that represents ASCII (text) data of an AngelCode BMFont file. The returned result object looks like this:

{
     pages: [
         "sheet_0.png", 
         "sheet_1.png"
     ],
     chars: [
         { chnl, height, id, page, width, x, y, xoffset, yoffset, xadvance },
         ...
     ],
     info: { ... },
     common: { ... },
     kernings: [
         { first, second, amount }
     ]
}

License

MIT, see LICENSE.md for details.

Versions

Version
1.0.6
1.0.3