PDA

View Full Version : [JEDI-SDL] (SFont) font generator ?



arthurprs
17-08-2007, 10:45 PM
I don't found ;/

How can i generate de fonts ?

arthurprs
18-08-2007, 09:17 PM
:?:

chronozphere
18-08-2007, 09:37 PM
I'm no SDL expert so i can only explain it generally.

This is how you usually generate a font:

> Create a texture/image
> Select a font
> Determine the size for each character in pixels on the image
> Draw all needed characters onto the image
> Make an array of Rectangles that contain the rectangles for each letter.

So when you want to render a text, you have to find the required charecter-rectangles.
Then cut them out of the image and render them in the right order. :)

You can also look for FontStudio (Nitrogen has made it). It's a nice tool to make bitmap-fonts.
This makes the whole thing alot easier. There are headers which have routines to read the needed rectangle information and render the font. You might like to take a look at those. :)

If you only need a basic font, there should be other way's to render them. You shouldn't waste time on this when you only want someting simple.

Hope this helps ;)

Edit: You might want to take a look at this (it's not pascal i know... but it might help you)

http://gpwiki.org/index.php/SDL_ttf

arthurprs
19-08-2007, 03:37 AM
I'm no SDL expert so i can only explain it generally.

This is how you usually generate a font:

> Create a texture/image
> Select a font
> Determine the size for each character in pixels on the image
> Draw all needed characters onto the image
> Make an array of Rectangles that contain the rectangles for each letter.

So when you want to render a text, you have to find the required charecter-rectangles.
Then cut them out of the image and render them in the right order. :)

You can also look for FontStudio (Nitrogen has made it). It's a nice tool to make bitmap-fonts.
This makes the whole thing alot easier. There are headers which have routines to read the needed rectangle information and render the font. You might like to take a look at those. :)

If you only need a basic font, there should be other way's to render them. You shouldn't waste time on this when you only want someting simple.

Hope this helps ;)

Edit: You might want to take a look at this (it's not pascal i know... but it might help you)

http://gpwiki.org/index.php/SDL_ttf

But i need a generator for SDL_Font ;/

arthurprs
20-08-2007, 05:41 AM
Forget...
I used FontToll, generated the bmp and XNA-XML
That i created my own parser and adapted XNA-XML to it =]