Namespaces
Variants
Actions

How to use custom fonts in Java ME

Jump to: navigation, search
SignpostIcon Palette 52.png
Article Metadata

Article
Created: firt (15 Apr 2007)
Last edited: hamishwillee (18 Jul 2012)

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/

This page was last modified on 18 July 2012, at 13:30.
115 page views in the last 30 days.
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved