Bold .ttf font with slick-util

Started by Aichi, November 10, 2011, 20:42:22

Previous topic - Next topic

Aichi

Hey,
I'm trying to display a bold .ttf font with slick-util. Using Font.BOLD at Font.createFont is not possible with my seperate .ttf font, it's only possible on build-in fonts.
I need a bold version of my font to display text with outline.
So is it possible to display bold texts with seperate .ttf fonts using slick-util
or create a second pre-bold font with a font editing tool?

CodeBunny

When you want fonts in games, it's definitely a good idea to not use .ttf fonts. They have to do an incredible amount of extra processing to be converted into images, and it wastes a significant amount of time.

Use this: http://www.angelcode.com/products/bmfont/

It lets you convert a .ttf font into a bitmap font beforehand. They are much, much faster to load. Additionally, you can edit the font image in GIMP or somesuch and have a more intricate look. (Ex: applying grain, edging, glow, blur, etc.)

There is an AngelCodeFont class in Slick2D that loads and uses the fonts generated by the font generator.

Aichi

Thank you. :)
Does AngelCodeFont also exist as a standalone class?
I prefer to not use Slick2D.

CodeBunny

I think it's marginally integrated with Slick, but that's not too difficult to change. What you should do is take the source code and convert it into a standalone class for your own personal use. It'll help you understand the code better, and it's not too much work (I've done the same thing before, but I integrated it with my existing code base so it's slightly different).

Aichi

Ok, I decided to use the Slick2D engine now. It's probably the best way I can create Java games with.
I didn't want to use Slick2D firstly because it seems to be no longer in developement, secondly because I thought
that engine would be not fast enough for me (but it's actually extremly fast) and thirdly because I have to live with
some features I miss (sprite rotation and clipping for example). I don't know how grave the last point will be atm.