Page 1 of 1

Speaking of fonts...

Posted: Thu Dec 04, 2014 4:43 pm
by Imerion
I've been working on converting a standard font (Open Sans) to a bitmap font to import in my game. I'm using the CBFG program for the conversion and it all works fine when implemented. But I'm having trouble with too much space between each character. Is it possible to decrease the distance between each character, even when not using a monospace font? I'm mostly just looking for the "optimal settings", or something like that. :)

I have included a screenshot of my current settings if that would help. :)

Re: Speaking of fonts...

Posted: Thu Dec 04, 2014 6:02 pm
by Kjell
Hi Imerion,
Imerion wrote:Is it possible to decrease the distance between each character, even when not using a monospace font?
Unfortunately there's no support for proportional fonts built-in ( i've requested this on May 7th, 2008 .. still waiting ). Personally i never use the RenderText component anymore ( for this reason among others ) .. but attached is a example that imports the FontData.dat file you can export from CBFG and uses it with the RenderText component ( Align = Center won't work properly though ).

Image

Here are the steps you need to follow ..

- Export your font as BMP + Binary Font Data (DAT) from CBFG.
- Import the ExportedFont.bmp file to the BitmapFromFile component in FontBitmap.
- Configure the Font component to match your CBFG configuration.
- Import the FontData.dat file to the FontDataFile component.
- Trigger the FileAction ( Read FontDataFile ) component once*

*You can do this by selecting it and pressing F5.

The example should look like this after processing FontData.dat ..

Image

Once you're done importing & processing FontData.dat, you can remove the CBFG group ( and rename the other components if you want ). And in case you're going to use many RenderText components, you might want to wrap the RenderCharExpression in a function.

If you have any questions, let me know.

K

Posted: Fri Dec 05, 2014 8:45 am
by airpas
didn't work here

Posted: Fri Dec 05, 2014 11:17 am
by Kjell
Hi airpas,
airpas wrote:didn't work here
Did you follow all steps or at the very least trigger the FileAction component ( as demonstrated below )?

Image

K

Posted: Fri Dec 05, 2014 1:19 pm
by Imerion
That is very smart! And works great! Another big thanks!

Posted: Fri Dec 05, 2014 4:01 pm
by airpas
Ops sorry Kjell, seems i skipped reading the infos .
it works great :D