Will have to rework this approach entirely.
So here's a little project I worked on a month ago before burning out.
It's essentially an Xtalk version of BitFontMaker2 by pentacom.jp, only I have no idea how to implement the actual TrueType font export , so this app lets you export the JSON format of the font and the BitFontMaker2 website can be used to generate the TTF format, then you can use open-source Fontographer to convert your TrueType font to the latest formats, if chunky bitmap fonts is what you are after.
The general idea behind this was to create little mini mazes like you might see in an old Atari 2600 game and store the data as text (1s and 0s) and extruded into 3D or to make console based games using only interesting text characters like Z80 computers did.
The BitFontMaker2 JSON format is simply a binary representation of which columns per row are filled, this makes for cleaner text files as opposed to strings of 1s and 0s, especially if you end up with 256 characters.
See where to put/get data into/from BitFontMaker2
Features:
- Smooth drawing (required an image object "image_0" on top of the graphics to capture the mousedown/move)
- Import black and white images and translate into the 16x16 bitmap grid.
- Export images single, all, and/or a font map (all characters on one image)
- Load JSON font data from BitFontMaker2 (add a text file to JSON folder for the file to appear in list)
- Export JSON data compatible with BitFontMaker2
- A little script window for scripting things (for the binary users)
- Animate frames: with patterns, ie, : 1, 2, 8, 6,4 or sequentially: 1-10 etc.
The Drawing surface uses graphics rects to represent pixels while the Fontmap display uses images to represent the characters/icons, so I have to generate images for you to be able to select them. Theoretically they could be generated in engine and exported directly to image objects, skipping the disk access?
You'll note a little "Todo" list menu in there. I tried to make a separate stack window for this but got into all kinds of annoyances with the keyboard and mouse being captured/blocked and messages going to the wrong stacks. I settled with the little menu so I can keep working without fighting to finish a non-user feature.
The mainstack ("GridDrawStack") contains the bulk of the scripts. You'll note a whole lot of globals. I used to never use globals as they did not pass from one stack to a substack and back without some trickery, but this time around I got sick of chasing custom properties and so took a risk on globals, they seem to work okay.
Well, have fun with it.