{"library":"parse-bmfont-ascii","title":"BMFont ASCII File Parser","description":"The `parse-bmfont-ascii` library is designed to parse ASCII-formatted BMFont (Bitmap Font) files into a structured JavaScript object. It specifically handles the human-readable text-based `.fnt` files generated by tools like AngelCode BMFont. This package, currently at version 1.0.6, was last published 11 years ago, indicating it is no longer actively maintained. It accepts either a string or a Node.js `Buffer` containing the BMFont data and returns a JavaScript object detailing font metadata (`info`, `common`), individual character properties (`chars`), kerning pairs (`kernings`), and referenced page textures (`pages`). Its primary function is to provide a lightweight, dedicated parser for this specific text-based bitmap font format, distinct from XML or binary BMFont variants. Given its age, it relies on CommonJS module patterns and does not inherently support ESM or TypeScript type definitions.","language":"javascript","status":"abandoned","last_verified":"Sun Apr 19","install":{"commands":["npm install parse-bmfont-ascii"],"cli":null},"imports":["const parse = require('parse-bmfont-ascii')"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"const parse = require('parse-bmfont-ascii');\n\n// Example BMFont ASCII data (simplified Arial.fnt structure)\nconst bmfontData = `info face=\"Arial\" size=32 bold=0 italic=0 charset=\"\" unicode=0 stretchH=100 smooth=1 aa=1 padding=1,1,1,1 spacing=0,0 outline=0\ncommon lineHeight=32 base=26 scaleW=256 scaleH=256 pages=1 packed=0 alphaChnl=0 redChnl=0 greenChnl=0 blueChnl=0\npage id=0 file=\"sheet0.png\"\nchars count=3\nchar id=65 x=1 y=1 width=20 height=20 xoffset=0 yoffset=4 xadvance=20 page=0 chnl=15\nchar id=66 x=22 y=1 width=20 height=20 xoffset=0 yoffset=4 xadvance=20 page=0 chnl=15\nchar id=67 x=43 y=1 width=20 height=20 xoffset=0 yoffset=4 xadvance=20 page=0 chnl=15\nkernings count=1\nkerning first=65 second=66 amount=-2`;\n\ntry {\n  const result = parse(bmfontData);\n\n  console.log('Font Face:', result.info.face); // Expected: Arial\n  console.log('Pages:', result.pages);         // Expected: [ 'sheet0.png' ]\n  console.log('Number of chars:', result.chars.length); // Expected: 3\n  console.log('First char ID:', result.chars[0].id);   // Expected: 65 (A)\n  console.log('First kerning amount:', result.kernings[0].amount); // Expected: -2\n} catch (error) {\n  console.error('Failed to parse BMFont data:', error);\n}","lang":"javascript","description":"This quickstart demonstrates how to use `parse-bmfont-ascii` to parse a string containing BMFont ASCII data, then log key properties of the resulting JavaScript object.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}