Page 1 of 1

BitFontMaker2Like: A bitmap editor

Posted: Wed Dec 06, 2023 11:45 pm
by xAction
[EDIT 3 months later:] I Had all the included fonts already generated on my computer after much programming and testing and did not realize generating the preview images was at least a minute long hang up, per font
Will have to rework this approach entirely.

Image
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.
When you choose a JSON file from the list, there will be a delay as the PNG files are generated in Documents/BitFontMapEditor/<JSON Font Name Folder>/

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.

Re: BitFontMaker2Like: A bitmap editor

Posted: Fri Dec 08, 2023 2:31 am
by OpenXTalkPaul
Cool, thank you so much for sharing!

Every time I see stuff like this brings back fond memories of being a 10-year old kid punching away a game listing from COMPUTE! Magazine on my Atari 400 (man that 'chicklet' keyboard was terrible) or trying to build a TARDIS picture out of Atari BASIC font's various shapes characters.

Rebecca Betancourt (Author of the xTalk OpenXION), who seems to be really into the retro-font stuff, built something like this but used Java with a Swing UI to build it, it's in her repos on Github if you want to compare notes.

As far the file format of a bitmapped-only TrueType font goes, sorry I can't help you there. To me that idea seems antithetical to the TypeType format which was created as an alternative to Adobe's resolution independent Postscript fonts. On classic macOS separate bitmapped representation at various point sizes where stored in it's resource fork, in a 'Font Suitcase" for the Font whole family, for Adobe PS fonts the bitmapped versions were stored in separate files.

OR...Perhaps you mean to have the end result be actually be a vector font that just looks like it's a bitmap font, for that Retro-80s look?

At any rate your editor really looks nice and clean.

I think we should have an 'OXT Shares' repo to collect nice community built tools like this, and as a replacement for the share-livecode site, because who knows when LC Ltd might shut that site down?

Re: BitFontMaker2Like: A bitmap editor

Posted: Tue Dec 12, 2023 6:40 am
by xAction
Oh apparently I forgot to upload a file!
BitFontMaker2Like.zip
(298.39 KiB) Downloaded 189 times

Re: BitFontMaker2Like: A bitmap editor

Posted: Tue Dec 12, 2023 8:09 am
by richmond62
open-source Fontographer
I assume you mean FontForge, as Fontographer STILL costs $259, which for something that has not been updated for at least 10 years is a bit "off".

https://www.fontlab.com/font-editor/fontographer/

https://fontforge.org/en-US/

This is also worth a look:

https://birdfont.org/

Re: BitFontMaker2Like: A bitmap editor

Posted: Wed Dec 13, 2023 12:07 am
by xAction
Yeah FontForge is the open source one, silly me the name was in my head but the fingers reverted to muscle memory.

Re: BitFontMaker2Like: A bitmap editor

Posted: Thu Dec 14, 2023 12:28 am
by OpenXTalkPaul
richmond62 wrote: Tue Dec 12, 2023 8:09 am
open-source Fontographer
I assume you mean FontForge, as Fontographer STILL costs $259, which for something that has not been updated for at least 10 years is a bit "off".
I can't believe they still sell Fontographer, I know it was stuck at like very 4.7 or something like that for ages. Is it even 64bit?

EDIT: Looked at their site and they did finally release a v.5, but it's obviously not 64bit since it says it only runs on 10.6 - 10.14.

Re: BitFontMaker2Like: A bitmap editor

Posted: Thu Dec 14, 2023 8:17 am
by richmond62
I have Fontograpoher 4.5, which I was given by the UAE UNiversity in Al Ain about 23 years ago, and deploy it on a Mac Mini PPC running 10.4.11 with Classic as cannot see any reason for forking out vast sums for something newer, and while FontForge IS good, it IS clunky.

Re: BitFontMaker2Like: A bitmap editor

Posted: Thu Dec 14, 2023 10:27 am
by richmond62
One thing I do not understand is that on the website the build automatically produces a TTF font with no apparent bitmap font in sight.