Bitmap font tutorial for windows
Monkey Forums/Monkey Programming/Bitmap font tutorial for windows
| ||
I'm messing around with fantomengine and the "CreateText" method for the last couple of hours, but I'm making no progress. I installed the "Bitmap font generator" and tried to create a font which would display in my app, but nothing so far. Is there some kind of tutorial/step-by-step guide on how to create a bitmap font that works with fantomengine? |
| ||
I don't know for sure but he probably explains it in his book: http://link.packtpub.com/Nh4hMA |
| ||
Well, sometimes you just have to sleep on it :D Not sure why it didn't work yesterday, but today it works just fine, here are my settings if somebody is struggling as well: ![]() ![]() ![]() Now go to "Options -> Save Bitmap Font as" After that you will get one or multiple ".png"-files and a ".fnt"-File. Rename the ".fnt"-filetype to ".txt", copy all the files that were generated into your GAMENAME.data folder and you are done :) |
| ||
I am glad you got it working. Where did you find that tool? So I can place a link into the fE Wiki? |
| ||
@christianstrang thx it's work. |
| ||
you can download the installer from here: http://www.angelcode.com/products/bmfont/ |
| ||
It looks for the Russian (add Cyrilic) language does not work, ie. I can get a picture with Russian characters and a text file from bmfont program, but something goes wrong, and when i try to run it on android me an error, on html work fine (use v66 with fEng ) |
| ||
I tried it myself and I also get an "Array index out of range" error message (tested in HTML5) |
| ||
Can you provide the font files and a test script so I can see if I can do something about it in fantomEngine? |
| ||
I tested this software, but I don't like it because I can't have some colored font easly or may be I don't know how to use it. |
| ||
@MikeHart: If the "char id=" is bigger than 255, for example "char id=256" it crashes. Basically if you select anything except "Latin + Latin Supplement" its going to crash, at least in my environment. Hope that helps to track down the issue :) @DarkCrystal: Which software are you using? I'm on windows so I can't use GlyphDesigner :( |
| ||
@christinastrang: I know, was just hoping you could provide a test script and files for my bug hunting. This way I safe time for downloading the software, learn how to use it, and and and! :-) time is money and I don't make any from it :-) |
| ||
Ah, gotcha sorry! https://dl.dropbox.com/u/49348646/works.zip https://dl.dropbox.com/u/49348646/fails.zip Its enough to load the font to crash it (without using it): font1 = eng.LoadFont("test_font") Which software do you use to create bitmap fonts? |
| ||
Thanks for the files. I am on a iMac and there I use GlyphDesigner. Love it! But of course, there is need to support other tools as well. |
| ||
Mmmh, the fails files can be loaded without an error. I wonder why. Will look into this. These are good too, because I didn't thought about supporting bitmap fonts spread over several images. |
| ||
Dooh, found my mistake and it crashes. |
| ||
@MikeHart so any chans to get it work with chr id = 1071 =) ?? |
| ||
Please test this cftFont.monkey file: https://dl.dropbox.com/u/23622899/cftFont.monkey Let me know if it worked. |
| ||
@MikeHart awesome, on my sony phone work fine.. many thx checked to be working: HTML ( chrom ) GLFW Android XNA FLASH can't check on iDevice =) |
| ||
Works like a charm (also tested it with cyrillic characters)! :D What is the limit of this though? I generated a file-collection with all the languages BMFont had to offer (2920 characters - 13 .png-files) and managed to crash it again (sorry!). I tried increasing the array limits to "4096" in the cftFont.monkey file but that didn't fix it. Thank you for your fast reponse and your help, I really appreciate it! |
| ||
Ah, I think its because the generated .txt file contains ID's that are over 917000 (no idea why the ID's are generated this way). I uploaded the .zip file if you are curious: https://dl.dropbox.com/u/49348646/all.data.zip |
| ||
You are crazy, that would be a memory monster. How many atlas files where defined? |
| ||
I will look into this tommorow. |
| ||
I think its just a flaw of BMFont on how it generates the ID's. Don't worry, I won't need this anyway, I'm fine with the latin characters and a few additional ones, but those work with the update :) |
| ||
@christianstrang can i repost ( and translate ) youer tutorial to http://monkeycoder.ru/ |
| ||
sure :) |
| ||
Could you please test if the ASC value returns that high value too? If it does, then i can try to support it. |
| ||
Not sure what you mean |
| ||
That character, that has that 917000 value, will that return a similar ASC value? Because to detect which Character has to be printed, I read from a text each character, determine its ASC value, and then find the corresponding bitmap. If Monkey doesn't support unicode, then I don't see a possibility atm, to support these characters. |
| ||
Ok, I have put the ftFont class into a blender, spinned it backwards, shaked and stirred it for 20 minutes and now I have fantomEngine supporting unlimited bitmap font images and characters. As long as you have enough memory. :-) I had to switch to a IntMap to store the single characters, but now it doesn't grab a new image for a char anymore but draws directly from the bitmap file. I hope it increases the drawing performance, or at least doesn't make it worse. Grab the file here: http://code.google.com/p/fantomengine/downloads/list |