# parse-bmfont-ascii

> parses ASCII BMFont files to a JavaScript object

Latest version **1.0.6** (published 2015-03-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install parse-bmfont-ascii
pnpm add parse-bmfont-ascii
yarn add parse-bmfont-ascii
bun add parse-bmfont-ascii
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.6 |
| Published | 2015-03-14 |
| First published | 2015-03-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 7 |
| Author | Matt DesLauriers |
| Maintainers | mattdesl |
| Keywords | ascii, parse, convert, bmfont, bm, bitmap, font, bitmaps, angel, angelcode, code, text, gl, sprite, sprites, stackgl |

## Links

- npm: https://www.npmjs.com/package/parse-bmfont-ascii
- Repository: https://github.com/mattdesl/parse-bmfont-ascii
- Issues: https://github.com/mattdesl/parse-bmfont-ascii/issues
- npm.io page: https://npm.io/package/parse-bmfont-ascii

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 1.0.6 (latest) — 2015-03-14
- 1.0.5 — 2015-03-13
- 1.0.4 — 2015-03-13
- 1.0.3 — 2015-03-10
- 1.0.2 — 2015-03-10
- 1.0.1 — 2015-03-10
- 1.0.0 — 2015-03-10

## README

# parse-bmfont-ascii

[![stable](http://badges.github.io/stability-badges/dist/stable.svg)](http://github.com/badges/stability-badges)

Parses ASCII (text) [BMFont files](http://www.angelcode.com/products/bmfont/).

Takes a string or Buffer:

```js
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](https://github.com/mattdesl/bmfont2json/wiki/JsonSpec). 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](https://github.com/mattdesl/text-modules) for related modules.

## Usage

[![NPM](https://nodei.co/npm/parse-bmfont-ascii.png)](https://www.npmjs.com/package/parse-bmfont-ascii)

#### `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:

```js
{
     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](http://github.com/mattdesl/parse-bmfont-ascii/blob/master/LICENSE.md) for details.

---
_Source: https://npm.io/package/parse-bmfont-ascii · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
