paullb
paullb

Reputation: 4325

Blackberry (Java) - drawing text in two different fonts

using the g.drawText function (two calls one for each text) is it possible to write text in two different sizes?

g.drawText("abc",0,0);

//whatever code to change font goes here

g.drawText("def",30,30);

Upvotes: 2

Views: 1302

Answers (1)

DaveJohnston
DaveJohnston

Reputation: 10151

The BlackBerry has it's own font classes. Try this:

// e.g. serif
FontFamily ff = FontFamily.forName("family-name");

// Use style bits from Font class, e.g. Font.BOLD
Font f = ff.getFont(style, height);

If you want to know which FontFamilies are available you can use:

FontFamily.getFontFamilies();

Upvotes: 3

Related Questions