BMFont2Lua is a tool that converts BMFont JSON data to a Lua table and reorganizes the character info array from index-based to id-based, simplifying how character info is accessed.
When you just convert a BMFont JSON, the output Lua table will just contain the character info array in index-based format.
The problem is: how can you access the character info by id when the array is in index-based format?
It is possible, but you will need to loop through the entire array to find the character info by id.
To solve this, BMFont2Lua reorganizes the character info array to id-based format, making it easier to access character info by id.
So instead of looping through the entire array to find the character info by id, you can simply use the id as the index to access the character info directly:
local charWidth = fontTable.chars[32].width- Open the application and you will see the main window.
- Click the "..." button to open a file dialog and select a BMFont file (JSON or .fnt with JSON content). If the output path is empty, the output path will be automatically set to the same directory as the input file.
- If you want to minify the output Lua table, check the "Minify" checkbox. It will remove all whitespace and line breaks from the output.
- Click the "Convert" button to convert the BMFont file to a Lua table. You should see this message when the conversion is complete:
So, that's all.





