using fonts problem

im having problems trying to load a font and display a string. all i seem to get is a little red blob.
heres the source code.

import java.io.;
import java.awt.
;
import java.awt.event.*;

// font found @ http://www.1001fonts.com/fonts/win/ttf/2932/myscars.zip

class FrameResponce extends WindowAdapter
{
public void windowClosing(WindowEvent e)
{
System.exit(0);
}
}

class FrameExt extends Frame
{
private Font gameFont;

public FrameExt()
{
	try
	{
		gameFont = Font.createFont(Font.TRUETYPE_FONT,new File("MYSCARS_.ttf"));
		
		setTitle("Font Test");
		setSize(640,480);
		setResizable(false);
		addWindowListener(new FrameResponce());
		setVisible(true);
	}
	catch(Exception e)
	{
		System.out.println("*** Exception ***");
		System.out.println("Message: "+e.getMessage());
		System.out.println("Cause:   "+e.getCause());
		System.exit(0);
	}
}

public void paint(Graphics g)
{
	g.setColor(Color.black);
	g.fillRect(0,0,getWidth(),getHeight());
	g.setColor(Color.red);
	g.setFont(gameFont);
	gameFont.deriveFont(64.0f);
	g.drawString("Loading...",getWidth()/2,getHeight()/2);
}

}

class FontTest
{
public static void main(String arg[])
{
FrameExt fext = new FrameExt();
}
}

first of all

use code tags

second, for your font to display correctly you need to:

a) have a true type font (.ttf) or adobe type1 font.
b) make sure that font has unicode support (must contain a unicode glyphe map)

It’s probably unicode problem.
was trying to use custom (non-system) font few days ago and I was greatly dissapointed. I mean if font dosen’t support unicode why not properly display things that it supports? I don’t even need something other then standard english letters. Anyway I was told to search for some converter that would convert font to unicode one, I didn’t searched yet.

i have fixed the problem by placing the above font in c:\windows\font folder and then replacing Font.createFont with the Font contstructor and now it works fine.

well it might work but it’s not a solution since you put stuff into user’s windows folder… but since it works that means createFont() should work also (or ???). I have the font in fonts directory and it dosen’t work.

you might as well just bitmap the entire font and then just draw each letter as an image. that will give you a boost in FPS anyway …

that’s a good idea, but it would be pain in the ass to cut out all characters in good size and there’s always font size problem.
Actually since I don’t have any important runtime created text I was planning to do all text in photoshop and then use pictures (if I don’t find proper unicode font).