Skip to main content

Fonts on phoneME

6 replies [Last post]
m4nti5
Offline
Joined: 2010-04-12

Hi all, i wanted to know which fonts are supported by the VM, i tried to use Courier new in a project ( i need all the letters to have the same size ) and the font ilustrated doesn't look like Courier new, thanks in advance,

M4nti5

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
brinkley
Offline
Joined: 2003-06-06

As I remember fonts are a phone by phone thing. However, LWUIT allows you add specific fonts to your application which would give you the consistency that your looking for.

m4nti5
Offline
Joined: 2010-04-12

Thanks for your response. It's time to be more specific, i'm using phoneME personal profile on Windows mobile 5. I have several windows made on AWT and i need "Courier new" fonts in some objects (like lists), now i've been looking to LWUIT and i'm not pretty sure about how i can port the fonts. Would you please give me an idea? thanks in advance

Message was edited by: m4nti5

brinkley
Offline
Joined: 2003-06-06

Light Weight UI Toolkit. See http://lwuit.dev.java.net for everything that you need.

brunogh
Offline
Joined: 2006-04-23

Me too! It seems that it throws a SecurityException and then uses the default one when I try to get a Font from a name.

Internally it calls System.getProperty("Arial");

[java] java.security.AccessControlException: access denied (java.util.PropertyPermission Arial read)
[java] at java.security.AccessControlContext.checkPermission(Unknown Source)
[java] at java.security.AccessController.checkPermission(Unknown Source)
[java] at java.lang.SecurityManager.checkPermission(Unknown Source)
[java] at java.lang.SecurityManager.checkPropertyAccess(Unknown Source)
[java] at java.lang.System.getProperty(Unknown Source)

I have printed the available fonts and it shows:

[java] Available Fonts:
[java] dialog
[java] sansserif
[java] serif
[java] dialoginput
[java] default
[java] monospaced

Any suggestions?

brunogh
Offline
Joined: 2006-04-23

I am using QT, but it seems it does not load the font properly. The dir path is blank:

[b]QtFontMetrics:[/b]

[i]static {
initIDs();
String s = File.separator;
String javaHome = (String) AccessController.doPrivileged(new PrivilegedAction() {
public Object run() {
return System.getProperty("java.home");
}
});
// String dir = "lib" + s + "fonts";
File f = new File(javaHome, "lib" + s + "fonts");
// String dir = f.getAbsolutePath();
fontNameMap = new HashMap(10);

String dir = ""; s = "";

/* Initialise table to map standard Java font names and styles to TrueType Fonts */

//6177148
// Changed all the physical font family names to the names that
// Qt can understand. We were having "times", "helvetica" etc
// as the physical font names and since it did not match what qt
// expects, we were rendering with some font that qt picked up.
// Following J2SE's convention of mapping
// "monospaced" and "dialoginput" has MonoSpaced Font (Courier)
// "sansserif" and "sanserif" has a sans serif Font (We just use
// "Sans Serif" for qt to pick some San Serif font. and the
// "default" font is a Sans Serif font
fontNameMap.put("serif", dir + s + "Serif");

fontNameMap.put("sansserif", dir + s + "Sans Serif");

fontNameMap.put("monospaced", dir + s + "Courier");

fontNameMap.put("dialog", dir + s + "Sans Serif");

fontNameMap.put("dialoginput", dir + s + "Courier");

/* This should always exist and is used for fonts whose name is not any of the above. */

fontNameMap.put("default", dir + s + "Sans Serif");
//6177148
}[/i]

Is that right?