Here's my code which makes the Font object:
And here's the code which draws the string with the font I want:
The text display has a very small size (1 or 2 px). How could I fix it? Here's the alternative, where I can manipulate the font size but not font family:
How could I manipulate the font-family and font-size at the same time?
Thank you!
try{
font = Font.createFont(Font.TYPE1_FONT, new File("ChalkDust.ttf"));
}
catch(Exception e){
}public class Text extends Actor
{
public Text(String str, Font font)
{
GreenfootImage image = new GreenfootImage(300, 60);
image.setFont(font);
image.drawString(str, 0, 0);
setImage(image);
}
}public class Text extends Actor
{
public Text(String str, Font font)
{
GreenfootImage image = new GreenfootImage("hello", 16, Color.black, null);
setImage(image);
}
}
