Dark Bit Factory & Gravity
PROGRAMMING => General coding questions => Topic started by: Pot Noodle on January 06, 2012
-
Anyone got some idea how textured fonts are laid out due to size, as I would like to be able to use different size fonts in my scroll routines like 16x16 32x32 and so on, is there a program that can lay em out for you?
any help appreciated.
-
I'm not sure I understand the question properly. Do you want a program that can create bitmap fonts for you or are you looking for some kind of format that bitmap font layouts adhere to?
If you want to make your own bitmap fonts. This is quite widely used and has been for a while: Bitmap Font Builder[url]. I think it's limited to plain coloured fonts but you should be able to jazz up the output in photoshop without too much hassle.
As far as layouts go, they're pretty different between bitmap fonts (in my experience) but a lot use ASCII ordering which helps when parsing.
Sorry if I've misunderstood... (http://www.lmnopc.com/bitmapfontbuilder/)
-
Thanks Raizor, I think I have it sorted, shame there is no way of working out the number of frames by the size on the fly
Global Font = LoadAnimImage("sfont16.bmp", 1, 16, 0, 944)
This one had me confused as the width is set to 1 but the fonts are 16x16, would I be right in thinking it is possible to create more frames than there really is? I/e 944
Thanks.
-
I think your after varying font widths. and this idea should help.
What you can do is design them as the maximum width of the widest letter for example M, and make sure it's rounded to the nearest sizes of, 8x8, 16*16, 32*32 etc etc. And then just place them in your image as a grid of letters per normal, and then in your load anim image routine detect the start and end size per character, perhaps use a mask colour that's unique say 0xff00ff, so your making like a font splitter.
-
I guess he's making the anim frames 1 pixel wide instead of 16 wide so he can sine scroll his font on a single pixel instead of single letter. He'd then need to plot 16 one-pixel-wide sprites per letter.
Jim
-
Thanks for that info Clyde, I will give it a try and see and Jim your bang on I worked it out by looking at the code
looping from 0 to 15 and drawing every time, that's why the total frames are 944 I'd need a calculator to work that one out ;D But thanks guys now I have to work out how to read Image Headers in Blitzmax ^-^