![]() |
|
Custom Font 12x24 CP437 with 24x24 for Roguelike - Printable Version +- QB64 Phoenix Edition (https://qb64phoenix.com/forum) +-- Forum: QB64 Rising (https://qb64phoenix.com/forum/forumdisplay.php?fid=1) +--- Forum: Code and Stuff (https://qb64phoenix.com/forum/forumdisplay.php?fid=3) +---- Forum: Works in Progress (https://qb64phoenix.com/forum/forumdisplay.php?fid=9) +---- Thread: Custom Font 12x24 CP437 with 24x24 for Roguelike (/showthread.php?tid=3978) |
Custom Font 12x24 CP437 with 24x24 for Roguelike - onetruetroy - 10-01-2025 My first post and project that I think is useful and complete enough to share. I created a font that defines the characters of Code Page 437 in a 12x24 bounding box. I tried with BDF and could not wrap my head around it. Same with FontForge. I discovered FontStruct and that made sense to me since it's perfect for creating bitmap fonts and downloading as TTF. I use this font in the IDE and in my text based programs. This follows the Unicode rules and the CP437 characters are in their correct Code Points throughout the different areas of the Basic Multilingual Plane. When I use PRINT for ASCII characters, they will map correctly and the proper glyph is displayed even in SCREEN 0 when the font is loaded as 24 height and MONOSPACE. The Null character seems to always show up as a boxed X, so I just _MAPUNICODE 0 TO 32 and that takes care of it. Since I wanted square tiles and objects for Roguelike and still print text with 1:2 ratio, I chose to add the custom characters to the Private Use Area U+E000 - U+EFFF. These will mainly be static square tiles of various patterns, objects, creatures, etc. I will definitely add animation frames as individual characters for player and actor avatars. I think I'll be able to add glyphs that extend outside the bounding box and will experiment. I'm defining U+F000 - U+F8FF as multiple 256-character sets starting with a stylized CP437 from U+F000 - U+F0FF. This lets me have ALL the characters I want without having to load multiple fonts. Maybe that's an awkward or non-standard way, but it works great for me. I also use this as my IDE font at 24 height. Please, try this font if you are interested and I would enjoy any advice and suggestions. FontStruct relies on ad revenue, so do NOT click on the big DOWNLOAD boxes. Click the small yellow Download below the text sample. I install the TTF file and have no problems. I have not tested out the other font formats and cannot vouch for the validity or accuracy of those. Code Page 437 Font 12x24 with custom characters Text of link in case I didn't format it correctly: https://fontstruct.com/fontstructions/show/2737654/cp437-12x24 Screen 13 Private Use Area U+E000... ![]() Screen 0 ASCII Extended ![]() Screen 13 ASCII Extended
RE: Custom Font 12x24 CP437 with 24x24 for Roguelike - grymmjack - 10-03-2025 THIS IS SICK!!!!! THANK YOU FOR SHARING. I love seeing stuff done with text mode. Well done and thank you for sharing! Was the process of using the font editor intuitive? Also just a quick plug for @a740g own font editor: https://github.com/a740g/VGA-Font-Editor I know it's not 100% the same, but it's relevant to your current work. RE: Custom Font 12x24 CP437 with 24x24 for Roguelike - onetruetroy - 10-06-2025 (10-03-2025, 04:14 PM)grymmjack Wrote: THIS IS SICK!!!!!Thank you! It's my pleasure to share, as I'm proud of this; although, it's not a program... yet. I find that the FontStruct web interface is the easiest one for me. It's Unicode support allows me to address every Codepoint and define a glyph for that character. The structure is great for my needs. There are many terrific fonts on the site and most are designed for print. I've downloaded some select ones that are suitable for text games, especially when they are monospace. I learned much by cloning a font then viewing and editing the glyphs. Creating an account is free. I like your font app and utility. I may use that in a program that needs 1:2 aspect ratio throughout. It does present a steep learning curve for me. Here is a sample map using the CP437 12x24 font in black on white (document) then white on black (typical display). The font can be used in SCREEN 0, but only the first 256 characters are available. For graphic modes, _UPrintString gives access to all characters simultaneously. ![]()
RE: Custom Font 12x24 CP437 with 24x24 for Roguelike - grymmjack - 10-06-2025 (10-06-2025, 01:57 AM)onetruetroy Wrote:(10-03-2025, 04:14 PM)grymmjack Wrote: THIS IS SICK!!!!!Thank you! This looks sweet. Please let us know when you have something we can play, etc. I'm down to try it!I have been researching Megazeux recently. https://www.youtube.com/playlist?list=PLqNVTZpOeTjNPd-eJOgZ5EFWIi_btY7Nn just for fun because I love those old school games and am a text-mode artist myself. ![]() https://www.digitalmzx.com/ This might be something interesting to you as well! Not saying you should use it or stop using QB64 Just sharing since it's adjacent to your OP.There are a lot of creative people doing awesome stuff with limitations like this, and that's what really inspires me too! Talk soon I hope! |