How to use custom fonts in Java ME
Article Metadata
You know that if you are working in Canvas mode in MIDP applications, you can draw text on any position on the screen, based on the system fonts installed on the phone.
But, you see some games and applications that uses some other cool fonts in their applications. How we can do this?
The solution is to use a bitmap-font solution. That is a large PNG file (or other graphic format) that have every character designed as an image. Then, you just have to read that image file and clip every character in another image. Then, to write a sentence, just read every character and draw it one after the other.
Great sample on this feature is hosted on http://developers.sun.com/mobility/midp/articles/termemulator3/


The link is ok and is nice, but this solution have one problem - when app using this technique is used in device with resolution higher or lower than the one that bitmap fonts were created for things start to get tricky. When presented in higher resolution bitmap font might become too small to be readable, in lower resolution font might get to big to fit in ui. How to tackle those problems? --warjan 22:27, 3 September 2009 (UTC)