Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Creating Bitmap Fonts

Author
Message
Somarl
13
Years of Service
User Offline
Joined: 11th Feb 2011
Location: UK
Posted: 14th Mar 2011 13:06
I have seen this referenced many times and would like to have a go at making my own fonts (or perhaps editing existing ones to suit) in something like photoshop and then be able to use them in DB. I have searched and searched and cant seem to find a definitive version of what to do. I think something in 'EXtends' may allow me to do it but i have no idea how.

Can anyone take me through this step by step without directing me to one of those bitmap font creators (which are normally either too small a grid, or no colours or something), what i want is to create them in photoshop or gimp and import them into DB.

Many thanks.
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Somarl
13
Years of Service
User Offline
Joined: 11th Feb 2011
Location: UK
Posted: 14th Mar 2011 21:19 Edited at: 14th Mar 2011 21:31
Thanks BatVink, i saw part of that tutorial somewhere else before but without the downloads and i didnt much understand what was going on. Now that i have a code section to have a look at and play around with i will see if i can understand it from that. Once again thanks.

Edit: Well, of the 460 lines of code that are in that project i understand barely any unfortunately so i have a long way to go before i can do something like that on my own. I havent a clue yet what memblocks are and what they are for although i hear them mentioned a lot i dont think they are in my book. I really didnt expect there to be quite that amount of work for one (i didnt think it would be easy either, but i really didnt expect that much) but i am glad of a working code peice that i may just be able to manipulate and pop into my own projects for now to give them a bit of pizazz

However i do have one question for now. I cant load the dds file that seems to hold the 2 fonts and therefore have no idea how big they are or what they are or what they look like. So i cant actually make my own as i dont know what is going on in the code. If someone could point out some of the important things that are happening and what i would need to make in gimp to 'import' that code into my project and make it work with my own personal font i would be most appreciative.
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 14th Mar 2011 22:16
The memblock section on that tutorial is now redundant, and can be done using a bitmap and GET IMAGE. The memblock techniaque was used before we had the ability to make transparent bitmaps. Now you can:

SET BITMAP FORMAT 21
LOAD BITMAP...

Then in a loop that goes through the character positions, GET IMAGE

You don't need to use DDS files, you can use PNG files to create your bitmap. As a starting point, you simply need to break up an image into 10x6 (or 10x10) blocks, and place your characters in it in ASCII sequence, starting with SPACE..

BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 14th Mar 2011 22:17
Bitmap font attached in PNG format for you to play with.

Attachments

Login to view attachments
Somarl
13
Years of Service
User Offline
Joined: 11th Feb 2011
Location: UK
Posted: 15th Mar 2011 00:18
This is brilliant, thank you. I will have a play with this soon and see what i can come up with. So i just replace the memblock part:



With something that gets splits up the bitmap like when you create a sprite anim? And you note how many blocks across your sprite sheet is and how many down then get it to cut those bits out and use them.

Im looking forward to doing this
Somarl
13
Years of Service
User Offline
Joined: 11th Feb 2011
Location: UK
Posted: 15th Mar 2011 01:04 Edited at: 15th Mar 2011 01:50
Ive gone and made a serious mess with this already im afraid. I cant even think of how to do a for loop to get images from a bitmap sheet thats 10x10 and ive deleted everything that says memblock in it but now quite obviously it wont work.

1) Load my bitmap
2) set format to 21 (so it can see the alpha?)
3) cut out 100 blocks and place them into images using a for loop
4) if i want to write ABDC (instead of ABCD for whatever reason)
i would have something like
(i think)
5) to position it i would do this? (i think)

6) ????
7) profit?

I think im missing something in the code which is taking each image and saying "Right, thats that character, and thats that one, thats an 'A' and thats a 'B'"
But after all that is done can i do away with the rest of the code in that tutorial? What about the options for kerning and spacing like that other one has. I think my lack of how memblocks work is not allowing me to figure out what is going on so i dont know what to replace with what? Can i simplify this to just a few small paragraphs.

Edit: Also this is as far as i got making an algorithm which grabs images in a 10 x 10 grid but because i suck it doesnt work, and i even know why it doesnt work (because following it only makes sense in some parts but not all) but i cant do anything about it.

So if anyone wants to help me out with that then 'bonus'
Rich Dersheimer
AGK Developer
15
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 15th Mar 2011 13:25
There is a great plugin for bitmap fonts...

Here

Login to post a reply

Server time is: 2024-11-22 23:16:09
Your offset time is: 2024-11-22 23:16:09