thedesk/app/node_modules/load-bmfont/json-spec.md
2019-09-12 23:38:13 +09:00

1.3 KiB

The spec for the JSON output is consistent with the rest of the BMFont file spec.

Here is what a typical output looks like, omitting the full list of glyphs/kernings for brevity.

{
  "pages": [
    "sheet.png"
  ],
  "chars": [
    {
      "id": 10,
      "x": 281,
      "y": 9,
      "width": 0,
      "height": 0,
      "xoffset": 0,
      "yoffset": 24,
      "xadvance": 8,
      "page": 0,
      "chnl": 0
    },
    {
      "id": 32,
      "x": 0,
      "y": 0,
      "width": 0,
      "height": 0,
      "xoffset": 0,
      "yoffset": 0,
      "xadvance": 9,
      "page": 0,
      "chnl": 0
    },
    ...
  ],
  "kernings": [
    {
      "first": 34,
      "second": 65,
      "amount": -2
    },
    {
      "first": 34,
      "second": 67,
      "amount": 1
    },
    ...
  ],
  "info": {
    "face": "Nexa Light",
    "size": 32,
    "bold": 0,
    "italic": 0,
    "charset": "",
    "unicode": 1,
    "stretchH": 100,
    "smooth": 1,
    "aa": 2,
    "padding": [
      0,
      0,
      0,
      0
    ],
    "spacing": [
      0,
      0
    ]
  },
  "common": {
    "lineHeight": 32,
    "base": 24,
    "scaleW": 1024,
    "scaleH": 2048,
    "pages": 1,
    "packed": 0,
    "alphaChnl": 0,
    "redChnl": 0,
    "greenChnl": 0,
    "blueChnl": 0
  }
}