Reputation: 468
I need to draw text of different sizes. however below code only gives choice where to place text not how big it will appear:
g.drawText("bla bla", aX, aY);
Do I have to use method above and then to scale bitmap into preferred height, or is there some other method to do it which i overlooked? Any example ? Thanks!
g.drawText("bla bla", aX, aY, sizeX, sizeY); <---- something like this?
Upvotes: 2
Views: 794
Reputation: 81489
The size of the text is controlled by the font. You can use setFont:
Font f1 = Font.getFont(Font.FACE_SYSTEM, Font.STYLE_PLAIN, Font.SIZE_LARGE);
g.setFont(f1);
g.drawString("BIG FONT", 0, yPos, Graphics.LEFT | Graphics.TOP);
Upvotes: 2