LWJGL
June 20, 2013, 00:02:23 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: LWJGL 2.9.0 released!
 
   Home   Help Search Login Register  



Pages: [1]
  Print  
Author Topic: Bold .ttf font with slick-util  (Read 2765 times)
Aichi
Newbie
*
Posts: 3


« on: November 10, 2011, 12:42:22 »

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?
Logged
CodeBunny
Nerdus Imperius
*****
Posts: 561



WWW
« Reply #1 on: November 13, 2011, 05:55:33 »

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.
Logged
Aichi
Newbie
*
Posts: 3


« Reply #2 on: November 14, 2011, 05:06:04 »

Thank you. Smiley
Does AngelCodeFont also exist as a standalone class?
I prefer to not use Slick2D.
Logged
CodeBunny
Nerdus Imperius
*****
Posts: 561



WWW
« Reply #3 on: November 14, 2011, 11:21:43 »

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).
Logged
Aichi
Newbie
*
Posts: 3


« Reply #4 on: November 14, 2011, 13:29:36 »

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.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines
SMFAds for Free Forums
Valid XHTML 1.0! Valid CSS!