Page 1 of 1

Font Sheet Builder. Character Sheet Builder.

Posted: August 30th, 2015, 3:02 pm
by robotnoir
Hi Chili. I just finished your Beginners C++ DirectX course. Cheers for that. It was great. During one of your videos, you mentioned that building CharacterSheets (or FontSheets, or whatever they are called) is a tedious task. Thus, I've whipped up this little app to do it for you.

It's written in VB.NET2015, so apologies for that. Still, it does produce FontSheets compatible with those used in Lesson21 of your Beginners course.

Thus, if anyone would like to use a different font, this tool will help them create the appropriate Bitmap with minimal effort. There are a number of options to play around with, but it's not too hard to work out. I've included a PNG with some basic instructions in the ZIP file.

Cheers!

Re: Font Sheet Builder. Character Sheet Builder.

Posted: August 30th, 2015, 6:58 pm
by albinopapa
Haven't used it, but I'm sure this would be super helpful. I've thought of doing the same, but haven't gotten around to doing a font engine yet. Judging by the pic, it looks pretty complete and easy enough to use, your program that is. Just curious what you do for the font rendering, DirectWrite/Direct2D, GDI+, other?

Re: Font Sheet Builder. Character Sheet Builder.

Posted: September 1st, 2015, 3:03 pm
by superstar1998
Nice tool! Played a little with it and it's really useful. I like all those features it has. :)
There was a problem while scrolling through those fonts. It suddenly crashed while I was scrolling down the font list and said that the location it was trying to access was protected. After opening the program again it worked perfectly.

Re: Font Sheet Builder. Character Sheet Builder.

Posted: September 1st, 2015, 11:42 pm
by robotnoir
albinopapa wrote:Just curious what you do for the font rendering, DirectWrite/Direct2D, GDI+, other?
I think I'm using GDI+ It's all done by creating a "Graphics" object based on your "Bitmap" object. The "Graphics" object includes many sweet functions that make it easy to draw 2D shapes and text.
The "Graphics" object even contains an awesome "MeasureString" function. You simply hand in a string, and a font. The MeasureString function then spits out a rectangle which tells you how many pixels wide and tall your text will be when you draw it. Knowing the dimensions of the text before you actually draw it allows you to tweak the offset, and center the text (or other stuff like that).

I'm not sure if you've looked at my code, but I've included heaps of comments, so if there's something I've done that interests you, it shouldn't be hard to find how I did it.
superstar1998 wrote:It suddenly crashed while I was scrolling down the font list
Sorry about that. I've been slack and didn't put any error handling in this app. Thus, if bugs occur, it will prolly exit without warning, and not even give you an error message explaining what went wrong.

It might be worth switching off "Auto-Preview" mode. At least that would prevent the app from sketching every FontSheet if you scroll-wheel down the list. Also, if you click the "Preview" button to manually create the FontSheets, the app will display a handy MessageBox if there are any problems with the options and settings you've chosen.

= = = = = = = = = = = =

I've been thinking about re-writing this app in C# so that the code is more familiar to people doing Chili's course. (I just wrote it in VB the first time coz that's my native tongue, so it's fast for me to develop and think at the same time.) Anyway, if you have any requests for extra features, just mention them in this thread and I'll try to include them when I do the C# re-write. Also, I'll include some error handling next time!

Cheers!

Re: Font Sheet Builder. Character Sheet Builder.

Posted: September 12th, 2015, 9:05 am
by robotnoir
As promised, here is Version1.1 of my Font Sheet Builder. Download this new ZIP file for the EXE, and the SourceCode, and a little PNG that explains everything.

==========
NEW FEATURES
==========
* Rewritten in C#.NET using VisStudio2012.
* Error Handling! If something goes wrong, the app should now tell you roughly what happened.
* Strikeout and Underline Text (as well as Italic, Bold and Regular).
* Now supports Transparent Backgrounds (although you have to save the image as a PNG and not a BMP for this to be any use).
* CharWidthOffset allows you to easily fine-tune all the values in the CharacterWidth string, which might improve the Character Spacing in your apps.
* A Help button. If you can't find my HelpFile, the app will spew out a fresh copy.
* A Slightly-Useful Advertising-Bar, which dynamically displays text based on the FontSheet and CharacterSpacing you have specified - which gives you an instant preview of how the text will look in your app. (Just don't click the AdvertBar, or you'll end up on my website. Actually, what am I saying? My website rocks! If you've got a WindowsPhone, come over and download all my apps.)

(If you REALLY object to my Advertising-Bar, feel free to stick with the old advert-free version of the FontSheetBuilder, OR you could jump into the SourceCode and tear the Adverts out yourself. Better yet - just disable the "OnClick" event, and change the Advert text to something hilarious. You know you want to.)