In the process of making the Matrix Rain screensaver for Screensaver-CE, I needed an easy way to take a bitmap file and convert it to something Convfnt could handle. To that end, I created BmpToConvfnt. You give it the image file and glyph sizes and it spits out the ascii font file that you can then pass into convfnt.

It may get expanded in the future to handle a more dynamic codepoint situation, but for now you just give it the start codepoint and optionally how many glyphs there are and off it goes.
Nice work Merth, this will come in handy for sure.
I've released v1.1 which includes more options:


Code:

Description:
  Converts a BMP image to convfont format

Usage:
  BmpToConvfnt <imagefile> [options]

Arguments:
  <imagefile>  Path to the BMP image file

Options:
  -w, --width <w> (REQUIRED)   Width of each glyph in pixels
  -h, --height <h> (REQUIRED)  Height of each glyph in pixels
  -s, --startcodepoint <s>     Starting code point (e.g., 32 for space, 65 for 'A'; defaults to 0)
  -n, --numglyphs <n>          Number of glyphs to read from the image (optional, defaults to all)
  --xpad <xpad>                Left padding, in pixels, before the glyph grid starts [default: 0]
  --ypad <ypad>                Top padding, in pixels, before the glyph grid starts [default: 0]
  --xcellpad <xcellpad>        Horizontal spacing, in pixels, between glyph cells [default: 0]
  --ycellpad <ycellpad>        Vertical spacing, in pixels, between glyph cells [default: 0]
  -o, --output <o>             Output file path (optional, defaults to input filename with .txt extension)
  -c, --charsfile <c>          Path to a text file containing characters to map to glyphs (optional)
  -help, /?                    Show help and usage information
  --version                    Show version information


See the readme for more details on how to use it.

Notably, this version allows you to point to a "chars file", which correlates codepoints for you, making it easier to use an image file laid out in a non-sequential manner.

Download:
https://github.com/merthsoft/BmpToConvfnt/releases/tag/v1.1
There are single-executable files built for windows, mac, and linux, or you can use the .net 10 version which isn't combined into a single executable (it's a smaller download because it doesn't include the framework shtuff needed to make it work, should work on any OS with .net 10 installed, so windows, linux, and mac are all supported). Up to you, really.

I'm considering making a web tool as well that can take in the same chars file, as well as adding support to output actual .FNT files for ease of use in other situations as well.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement