GlitchCog / ChatGameFontificator

A Twitch chat display that uses the fonts of various video games
The Unlicense
91 stars 13 forks source link

Custom Themes Fonts. #17

Closed ramunegaming closed 4 years ago

ramunegaming commented 4 years ago

I recently found this chat and I love it but I would like to make a custom font for a theme DOS so I was wondering how I could go about doing this.

DOS uses this terminal font https://en.wikipedia.org/wiki/Code_page_437#/media/File:Codepage-437.png However the grid is not lined up how your example grid is. Is there any way of getting this to work?

For the theme visuals, I would like it to look like this: https://en.wikipedia.org/wiki/Code_page_437#/media/File:Codepage-437.png

The top text saying windows aren't necessary but I'd like usernames to come up like C:\users*twitchname*> but I'm not really know how I could go about this. Also, no border because I want it to feel like when you booted up an old pc so just a black screen.

One last thing. You mentioned you ripped the themes from ROMs/ISOs can I ask how that process works. I'd love to rip some retro dos game files to make custom themes for those games.

Any help would be appreciated. Keep up the good work :)

GlitchCog commented 4 years ago

Hey, I went ahead and added that DOS ASCII font to the Fontificator for you, so just re-download the JAR and it should be in the list. The PNG file for it is here in the repo: https://raw.githubusercontent.com/GlitchCog/ChatGameFontificator/master/src/main/resources/fonts/dos_font.png

The technique I use to line up a font to the grid is to just create a 8x12 grid in Photoshop where the cells are the dimensions of each character, then move each character into it. Then you have to make the characters white on a transparent background. It's not trivially simple if you're not versed in the world of graphics manipulation, but it's not too difficult either. More tedious than challenging.

And if you want to have no border, simply drag the border scale slider all the way down to zero with any random border selected, and it'll disappear.

The "theme visuals" example you posted is the same URL as the font... did you mean to show something else? Ooo, just had an idea... use the extended DOS ASCII characters for the borders and corners to make a DOS border. I'll probably do that for you.

As for changing it to say C:\users\twitchusername> instead of twitchusername:... that's less simple because it's not configurable in the code. If I can find the time later, I'll add a feature to make it configurable somewhere perhaps.

Thanks for using the Fontificator, glad you like it!

GlitchCog commented 4 years ago

One last thing. You mentioned you ripped the themes from ROMs/ISOs can I ask how that process works. I'd love to rip some retro dos game files to make custom themes for those games.

Sorry, I didn't address this question in my last post!

So, for ROMs there are programs people have written, like YY-CHR, that allow you to load up a ROM image and scour through it for data that looks like sprites. A lot of times in a NES ROM or something, the font will just be in an uncompressed sprite format, and you can export it into an image file. The ISOs are a little harder. Often the fonts are stored as a texture in them, so you can run an ISO with an emulator, then attach some sort of texture ripping add-on to dump all the textures that the emulator loads. If you're lucky, when the text appears, it'll dump a texture of the whole font when that happens.

As for ripping sprites out of DOS games... I have no experience with that. I'd imagine a lot of them used the exact font you referenced, but if not, there isn't a single method for storing a font in a game. Every game developer probably used a different format for storing their font data, and back then, there wasn't even a standard PNG or GIF format to use. And then however the data were stored, it might have been compressed somehow into the EXE or COM file. Or hidden away in some sort of asset blob file that the executable reads. If you want to rip fonts from a DOS game, I'd say your best bet is to emulate it in DOS box and screenshot your way through to get all the characters via the in-game dialog. Then take those screenshots and compile them letter-by-letter into a single sprite sheet. That's the technique I use for some of my rips, especially the DS games where I haven't been able to find any good helper programs. It's super useful if there's a place you can input your own text, like a naming screen. Just name yourself stuff like "!\"#$%&'()*", then screenshot, reset, and do "ABCDEFG", all the way through "uvwxyz{|}~". It's tedious, but if you really want that font, it's probably less work than trying to reverse engineer a long-lost only-used-once file format from a DOS game.

ramunegaming commented 4 years ago

Wow... Lots of wow. I was expecting a quick tutorial but man, did you go above and beyond! I am very appreciative of this. I always feel like DOS doesn't get enough love so I can't wait to check out this new font.

I didn't even think about doing it that way. I don't think it'd be too tedious with photoshop to align up font characters so I'd like to practice :).

I did spend a good while trying to find programs to access the files but didn't have much luck. I did find a viewer but there is no way to actually save the files so it's not that useful for this. I think your idea of naming myself a few characters at a time is actually a great idea. That being said as you mentioned most games do use the stock font that DOS uses but some games do have custom fonts which I'd love to get working in your chat system :).

GlitchCog commented 4 years ago

Okay, I just added the option to customize both the "username format" and the "content breaker". Together they will let you implement your C:/User/USERNAME> formatted message. The now-configurable content breaker is the ": " value that separates the timestamp and/or username from the content of the message. And the now configurable message format allows you to put text before or after your username. In the username format, the text %user% will be replaced with the username, and you can put text before or after that value, or include multiple instances of that value, to affect how the username is formatted for display.

So to get your specific request, you'll need to set the username format to "C:\User\%user%" and the content breaker to "> " (with a space after the carrot) and you'll have what you're looking for.