font styles

Hi is it possible to change the font of a drawString object like times new roman or Ariel?
[97 byte] By [shienna17a] at [2007-11-26 21:36:47]
# 1
http://java.sun.com/javame/reference/apis/jsr118/javax/microedition/lcdui/Graphics.html#setFont(javax.microedition.lcdui.Font)
suparenoa at 2007-7-10 3:18:28 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 2
it doesnt mentioned anything about the actual font style ie, times new roman, ariel, ariel bold etc.. I've read the api already and know that you can change the size, bold/italic, underlines but what about the actual FONT?
shienna17a at 2007-7-10 3:18:28 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 3
Just read java documentation of javax.microedition.lcdui.Font class.The first paragraph must answer your query.~Mohan
itsmohana at 2007-7-10 3:18:28 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 4
Font is set by default to : Font.getDefaultFont(). (no style, no size, just sytem face or something like that)to see which Font is it, do Font.getDefaultFont().toString().
suparenoa at 2007-7-10 3:18:28 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 5
i get the following message, microedition.lcdui.Font@e51what does that mean? is it the system face i must change? if so what value? can you give me an example please on how to change the font into an ariel for example? thanks
shienna17a at 2007-7-10 3:18:28 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 6

The Font class java doc says the following:

The Font class represents fonts and font metrics. Fonts <b>cannot be created by applications<b>. Instead, applications query for fonts based on font attributes and the <b>system<b> will attempt to provide a font that matches the requested attributes as closely as possible.

It depends on the font rendering engines ported on individual devices running on different O/S. The Java API will never mention what kind of font it is like Ariel, Verdana, etc.

~Mohan

itsmohana at 2007-7-10 3:18:28 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 7
read this http://developers.sun.com/techtopics/mobility/midp/articles/termemulator3/and this http://java.sun.com/j2me/docs/wtk2.2/docs/UserGuide-html/internationalization.html#wp22805the first one is good !
suparenoa at 2007-7-10 3:18:28 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 8
Xellent article supareno !!!I believe will affect the application performance a bit on lower end devices.~Mohan
itsmohana at 2007-7-10 3:18:28 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 9
> Xellent article supareno !!!thanks..> I believe will affect the application performance a> bit on lower end devices.sure
suparenoa at 2007-7-10 3:18:28 > top of Java-index,Java Mobility Forums,Java ME Technologies...