开发者

How to create own bitmap font wiht image on LWUIT?

I use that code

Font bmpfont=Font.createBitmapFont(icon, new int[0], new int[12], "S");

First param is image, second is offset, third is length and fourth is charset. And I get Font object fr开发者_如何学Goom that code. But I set that font to TextArea...

TextArea ta=new TextArea();
ta.getStlye().setFont(bmpfont); 
ta.setText("S");

Text Area display only "S". Then I want to know how to create my own bitmap font and how to add that font to use. I want to make many bitmap fonts.


Generally we expect you to use the bitmap font creation tools within LWUIT and not invoke this method which is intended for internal use.

Regardless its plainly obvious you used the method incorrectly since the cut offsets don't contain the locations within the font.

Just use the resource editor or Ant task to create a font and then set that font either via the theme or by manually extracting it from the resource file.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜