Skip to main content

LWUIT PhoneME and Font size

7 replies [Last post]
zenman
Offline
Joined: 2009-08-10

I am writing some MIDP apps. I am porting an app which runs pretty well on IBM J9, except for a couple of annoyances. It seems that the Font properties are different when I use the IBM JVM and PhoneME.

this is the JWUIT code.
int fontHeight com.sun.lwuit.Font.createSystemFont(com.sun.lwuit.Font.FACE_SYSTEM, com.sun.lwuit.Font.STYLE_PLAIN, com.sun.lwuit.Font.SIZE_SMALL).getHeight();
The Small size is supposed to be 10.

On the IBM is get a font height of 10 but on PhoneME, I get a height of 24.

this is Windows Mobile 6.1 and I am using PhoneME: Foundation_Profile_MIDP-phoneme_advanced_mr2_b154-win32_arm_wm6-bin-rev20331

The fonts are HUGE for PhoneME but appropriate on J9 I am not sure how to reduce, is there a PhoneME setting? LWUIT says this is PhoneME issue, is it?

Thanks,

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Hinkmond Wong

phonemeadvanced@mobileandembedded.org wrote:
> I am writing some MIDP apps. I am porting an app which runs pretty well on IBM J9, except for a couple of annoyances. It seems that the Font properties are different when I use the IBM JVM and PhoneME.
>
>
> this is the JWUIT code.
> int fontHeight com.sun.lwuit.Font.createSystemFont(com.sun.lwuit.Font.FACE_SYSTEM, com.sun.lwuit.Font.STYLE_PLAIN, com.sun.lwuit.Font.SIZE_SMALL).getHeight();
> The Small size is supposed to be 10.
>
> On the IBM is get a font height of 10 but on PhoneME, I get a height of 24.
>
> this is Windows Mobile 6.1 and I am using PhoneME: *Foundation_Profile_MIDP-phoneme_advanced_mr2_b154-win32_arm_wm6-bin-rev20331*
>

Hi zenman,

Where do you get the build (above)? Do you download it from Davy P's site?

Thanks,
Hinkmond
[att1.html]

zenman
Offline
Joined: 2009-08-10
davyp
Offline
Joined: 2007-01-03

Hi

They are not the same. The first link is indeed my website which has builds based on
more recent development snapshots. These builds are not officially supported
by the official phoneME maintainers. I just make them in my spare time. The second
link is an "official" build by the phoneME project, but already a couple of years old.

Anyway, I am not sure what is going on, but it might have to do with the resolution
of your display. I have builds which by default do 96dpi emulation. So on a device
with a 480x640 resolution at 192dpi, it would appear as if your resolution is 240x320.

If you on the other hand don't do the emulation on e.g. a 480x800 resolution, the
text is hard to read and I multiply the font size by 2 depending on the dpi. I also have
separate patches to rescale the skin bitmaps. The advantage of rescaling the fonts
and the bitmaps over doing 96dpi emulation is that fext and bitmaps become more
crisp. However, I don't always check all possible configurations of my binary builds and
maybe something went wrong while applying the patches.

I will check on a few devices. Just in case, could you tell me what kind of device you
are using?

Cheers,
Davy

zenman
Offline
Joined: 2009-08-10

This is a Samsung i760 phone running WM6.1.

The resolution is 320x240. I used the microemulator 3.0snap for emulation in netbeans. The fonts looks good there as well as IBM J9.

I like your build because the magic command to run Midlets as well as loading the Bluecove libraries are documented well.

-Xmx2m "-Xopt:useConsole=true" -Dmicroedition.profiles=MIDP-2.1 -Dsun.midp.library.name=midp "-Xbootclasspath/a:\phoneme\bluecove\bluecove.jar" "-Dsun.midp.home.path=\phoneme\foundation\midp\midp_wince" -Dcom.sun.midp.mainClass.name=com.sun.midp.main.CdcMIDletSuiteLoader sun.misc.MIDPLauncher -midppath "\phoneme\foundation\midp\midp_wince\classes.zip" -suitepath "\apps\share\Midp.jar" -1 com.xxx.MidletName

Of course everything is different using the java.net version and I have yet to figure out the magic there.

davyp
Offline
Joined: 2007-01-03

That is odd, I would expect that your device has a 96dpi resolution and that there would
be no rescaling necessary. Can you check what happens with the "Native DPI" and "High
Resolution" versions of the dual stack build?

Regards,
Davy

davyp
Offline
Joined: 2007-01-03

I just checked my latest builds on various devices, and I have not seen anything out of the
ordinary on several low res and hi res devices. If you have some simple test code with which
I can try to reproduce the problem, that would be most helpful.

Davy

zenman
Offline
Joined: 2009-08-10

Was the native DPI always there? I saw it for foundation but not for advanced. Anyways, the native DPI worked, font normal - Bluecove works great. I think I will use the other version for the high resolutions so I am covered there as well. Great stuff. Next step is creating .cab for installers without Microsoft Studio - another thread. Thanks