View Full Version : TBGL Font Creator [ UPDATED Feb 23 2013 ]
Petr Schreiber
04-07-2007, 22:54
Hi all,
This tool allows you to create BMP texture in power of two size from 256x256 to 4096x4096 for use with TBGL_LoadBMPFont.
Sizes 256x256 and 512x512 are safe for any hardware today, for the bigger ones better to check first for supported texture size.
Hope you will like it,
Petr
Updates
1.1 - saves to TGA with alpha, color fades for font
1.3 - allows elemental shading and outlining
1.4 - application has fixed size window, ability to export 256x256, 512x512, 1024x1024, 2048x2048 and also 4096x4096 bitmaps
1.5 - user can specify shadow offset
1.6 - added support for symbol fonts (thanks Rene for noticing problem)
ErosOlmi
04-07-2007, 23:06
No Petr, I DO NOT LIKE !!!!
I do not like that you waited so long to give this 41Kb perl to the world !!!
You will be punished! Be prepared!
;D ;D ;D
ErosOlmi
04-07-2007, 23:10
I was so upset that ... >:( >:(
;D I have created a dedicated forum !!! ;D
Petr Schreiber
04-07-2007, 23:13
;D
Eros - worst is I started to code that program before 2 hours.
TBGL_LoadBMPFont is in TBGL since 2005 aaargh :)
Thanks for new forum branch !
Bye,
Petr
P.S. In the meantime I am getting ready for the punishment. Must locate nearest gunstore ... :D
Michael Clease
04-07-2007, 23:21
Ive been using this because it does alpha channels.
Petr Schreiber
04-07-2007, 23:28
Hi Abraxas,
nice one, I didn't knew about this.
I used other good one, but it was not localised to english so it could be bothering for someone.
I think it could be good to create "TBGL certified" tools with no need to be scared of license and other stuff too, so will try to improve TBGL Font Creator in future.
Thanks,
Petr
Petr Schreiber
04-07-2007, 23:33
Hmm,
so you must be sad TBGL loads just not alphed BMPs for fonts...
I have modified TBGL_LoadBMPFont code to take both BMP and TGA now, it will be present in next TBGL ( 0.2.1 ) release.
Bye,
Petr
Petr, this is most excellent. A valuable tool and wonderful new addition. I am so glad you are on summer break and have time to create wonders for us!!
Excellent Programme Petr. :)
Some Months ago someone on the Basic4GL Forum wrote a Font Conversion Programme which would convert TTF Fonts to a 256x256 PNG Charset. You can read about it here (http://basic4gl.proboards20.com/index.cgi?board=demo&action=display&thread=1173473405).
But it was written in GFA Basic and didn't work on some peoples Computers. :P
Is there any chance that you could add the option to save the Texture in the PNG Format?
Petr Schreiber
05-07-2007, 09:43
:)
Thanks a lot for the replies!
Matthew, PNG fileformat seems to be my destiny, like Prince of Persia was chased by Dahaka beast, I wake up at night crying "PNG!" :D
B4GL proggie looks very cool!
Writing of the PNG file should be easier than reading, I will see what I can do.
TGA with alpha should be easy, and will be probably done first.
I have also planed few post process features for the bitmap, will see how fast it will go.
Thanks,
Petr
Petr Schreiber
24-08-2007, 23:14
Hi,
tiny update commited, please re-download from first post.
TGA texture save is here ( to store alpha ), the most visible change is option to choose color-to-color fade for font.
Hope you will like it.
Petr
Thanks Petr, can't wait to try it out this weekend! It is really nice. Thanks Petr, the going between colors is a super addition!!
When you have time maybe color left to right might be neat option or 45 degrees if possible. Not all at the same time, but one from an option.
up/down or left/right or diagonal left/right.
I can't think of anything else really. Thanks this is fun to play with and I am sure will add lots to projects!
Petr Schreiber
24-08-2007, 23:55
Thanks,
I will relax now a bit but I think it should be practicable.
I am just not sure if it will not strike eyes too much to have diagonal or left-right fades, but I will try.
Thanks,
Petr
No rush, just to make it complete it would be nice if doable. This is more than I ever hoped for already, so thanks!
Michael Hartlef
08-02-2008, 14:51
Hi Petr,
can it create shadows and outlines?
Great tool btw.
Michael
Petr Schreiber
08-02-2008, 15:37
Hi Mike,
both requests a bit tricky, but both on the wishlist and in process.
I think outlines could be done first, will have a look at it!
Bye,
Petr
Petr Schreiber
08-02-2008, 20:48
Mike,
I am working on it :)
In the meanwhile, you can see improvement in handling of color fading on attached picture.
The upper line is how it will look in new version once it will be out, the lower one how does it look in current release.
The new one maintains antialiasing of characters, which results in much smoother and font shape accurate results.
Big issue is doing outlines plus fadeout, it has some artifacts I strongly dislike so there is still lot of work. So second picture shows outlines, but with single color body.
Bye,
Petr
Michael Hartlef
09-02-2008, 11:45
I like the antialiasing.
Michael Hartlef
01-08-2009, 12:05
Thanks Petr for posting the new version. :)
Hi, Petr
I realized that BMP fonts have excellent quality if 2 conditions are met. 1 - good font file and 2 - TBGL window working with antialiazing and filtering on. The texts are simply great. The problem is that the font creator app handles only 512x512 pix image files. 512x512 will be ok for small size texts if text quality in the file is ok but the truth is that the antialiazing and the alpha channel are not very good. 4 times super-sampling can fix the problem. I can do it manually its not big deal.
Is it very hard to change it to work with bigger files? Like just add some more values in the image size drop-down menu. 4k x 4k will be really great. Well generally 1k x 1k will be sufficient for nice texts on screen but final texture will be scaled down (sub-sampled) by factor of 4 /like in Photoshop or something else/ so any aliazing issues will be gone. Even Intel GMA adapters handle 4k x 4k textures well nowadays. Its some kind of nightmare to write good quality texts in DX or OGL.
Last question: is it possible to redirect text output to texture instead of screen ? Its just a question.
Plamen.
Petr Schreiber
05-01-2011, 10:14
Hi Plamen,
thanks a lot for your suggestion!
I will implement first the pick of resolution and then I will look into the direct texture creation, which sounds like a good idea as well.
Petr
Petr Schreiber
05-01-2011, 16:10
Hi Plamen,
please visit the first forum of this thread for update version of the program :p.
Petr
Thanks a lot Petr,
It's awesome. I tested 4k x 4k and after down-sampling to 1k no traces of aliazing are visible. Letters are beautiful. You are my hero!!!!!
ReneMiner
27-10-2012, 16:03
I just wonder why this is not built-in at thinAir-Menubar "Tools/Utilities" yet?
Could it be improved just a little bit so user can select distance of shadow from letter?
Petr Schreiber
27-10-2012, 17:17
Hi,
I updated the program with user defined shadow offset, please download from the first post of this thread :)
Petr
Charles Pegge
28-10-2012, 05:27
If you don't mind using standard TrueType fonts, used by the system, Opengl outline fonts are very versatile. (wglUseFontOutlines), Scaling is unlimited and they are even fast enough to use for an editor.
Charles
ReneMiner
28-10-2012, 14:13
cool!
I like it, especially fading effect is very cooooool. :)
ReneMiner
22-02-2013, 23:29
Sorry if double-post, but I miss that tool still beeing accessable on thinAir Tool\Utilities-Menu - would be nice to have it next to Charmap there.
...so I had to download it once again...
Some crazy idea I just had:
create some "sprite-sheet"-sized to a fonts format and use TBGL_PrintBMP for the sprites then :eusadance:
Would it be possible to load and display fonts which are not currently installed on the system?
Petr Schreiber
23-02-2013, 11:53
Hi Rene,
Some crazy idea I just had:
create some "sprite-sheet"-sized to a fonts format and use TBGL_PrintBMP for the sprites then
to use TBGL_PrintBMP for sprites you just need to supply image with sprites placed on grid 16x16 tiles, then it should work.
Would it be possible to load and display fonts which are not currently installed on the system?
I don't know where would the program take the information about how the font looks in such a case :)
But you can generate the BMP/TGA on system where font is and then use this BMP to draw this font on any PC from the bitmap.
Sorry if double-post, but I miss that tool still beeing accessable on thinAir Tool\Utilities-Menu - would be nice to have it next to Charmap there.
Please make the request in the support section (http://www.thinbasic.com/community/project.php?projectid=2) - this is the place where developers go to check what is needed to add.
Thanks,
Petr
ReneMiner
23-02-2013, 12:22
A problem to the FontCreator: it does not display Dingbat-Fonts (i.e. Wingdings, Webdings & similar) to create bitmaps from :(
Petr Schreiber
23-02-2013, 21:32
Hi Rene,
good catch, please download corrected version from here:
TBGL Font Creator [ UPDATED Feb 23 2013 ] (http://www.thinbasic.com/community/showthread.php?8200-TBGL-Font-Creator-UPDATED-Feb-23-2013)
Petr
ReneMiner
23-02-2013, 23:41
I have a suggest for another function as "Outline" - just has to print one pixel offset in all 4 directions in outline-color and print centered onto it in desired font color.
So its just like the shadow-offset in all directions just small amount (1) for small textures (256) etc. or user defines thickness. For very large textures (1024+) the shadow could be printed in 8 directions so it becomes smoother.
Outlines could have color-fading too, can make cool effects and spookie hollow fonts then
ReneMiner
26-02-2013, 18:02
Another one: Either load a with some 3rd-party graphics utitlty/self made pre-drawn bmp/tga-file and draw the charakters then onto it -
or enable some background-colors that can fade as the charakters can. So it would be easy to create some blinds or buttons close to the look of the bottom-bar (Who's Online...) of this forums page. I hope you understand what I mean by that.
Hi
I see that a good work have been done here. But for some fonts the widths are just necessary to write a beautiful text.
In bitmap fonts there are several ways to specify letter widths. the easiest is to load an xml file or txt file with the same name of bitmap
wich contains the data for each letter.
I used to work with "littera" website for creating such data files. it's awesome , free and online (with the possibility to save the project not only the
bitmap)
the problem is to reprogram the printbitmapfont function according to that file format. i think is not so hard. (just load the txt or xml file to memory)
check it out you wont be disappointed:
http://kvazars.com/littera/
:D
Petr Schreiber
07-05-2016, 07:11
Hi,
you are right correct spacing can make a difference. Thanks for the tip!
Lot of work has been put to the linked solution, and it has nice, efficient bitmaps. I will check how difficult it would be to add support for this :)
Petr