I have written a batch script to simply the creation of the .mof files needed by MoSync. It automates the process of creating .mof files for multiple font styles, sizes, and colours. No more tediously clicking through BMFont dialog windows and repeated calls to mof.exe!
HOW TO USE
1. Download the 'EasyMofCreator.zip' file attached to this post. Unzip the contents to get the 'EasyMofCreator.bat' file and place this script into the BMFont directory of the MoSync install. For me this is "C:\MoSync\bin\BMFont\".
2. Open BMFont (using either the start menu shortcut or the BMFont.exe file in the directory above). In "Font settings set 'Charset' to OEM:ANSI to make sure only the right characters are displayed in the main window. Now pick and choose which characters you wish to include in your .mof files, and then close the application (don't forget this - your configuration is only saved on exit!).
For the script to be successful the Texture Width and Height (in the Export Options dialog in BMFont, shown below) but be large enough. Don't worry though - the script will tell you when this is a problem!

3. Double-click on the "EasyMofCreator.bat" file to run it. Voila! A "fonts\" directory is created filled with small selection of lovely .mof files!
CUSTOMISING THE SCRIPT
You can easily customise the fonts, sizes, and colours created but opening the script in a text editor and editing the first three variables (lines 6-8). Font names are written in plain text (comma separated) with two optional modifiers which can be added at the end of each name: ;b for bold and ;i for italic.
eg: Arial;b,Courier New;i,Impact;b;i
The size are colour variables are more straightforward, and are adequately explained within the file.
I must warn you that the "fonts\" folder is cleaned before each run, so remember to copy the fonts to your project folders rather than referencing them here.
LIMITATIONS
The script cannot resize the texture width and height automatically, as this depends on the font, font style, font size and character selection - too many variables!
Hope this comes in handy for somebody! :D
Felix Kenton
Update: This file will be deleted when you install a MoSync update over the top of your existing directory, so remember to keep a backup copy if your configuration is important.
| Attachment | Size |
|---|---|
| EasyMofCreator.zip | 1.8 KB |