As you may have noticed I have been trying to get a Windows Java runtime to
run under Wine.  I am getting odd behaviour with both the IBM and Sun JREs,
but the Sun one is the most odd.

If I run a very simple test program which displays the word "text" in a
window, it works.  Then I make sure all Wine processes are killed and gone
from ps, run it again and I get a row of 4 theta (Unicode 03b8) characters.
Then run it again and it works.  This is repeatable.

So I ran with -debugmsg +gdi,+font,+text to see what was happening, and if
I could spot the difference.

The bit where it fails has the sequence:-

SelectObject
GDI_GetObjPtr
X11DRV_SelectObject
xxxxx
X11DRV_FONT_SelectObject
XFONT_RealizeFont
GDI_ReleaseObj

In the case where it works xxxx is XFONT_UnAlias found font
'Arial'->'Helvetica' and when it does not work this line does not appear.

There is very little different before this, and none of it looks relevant.
There are a few differences, but they are all (I think) things like buffer
address which are passed in by Java.

I added some debug traces to XFONT_UnAlias to see what it was looking for,
and found that in the case it was working it was looking for Arial, but
when it failed it was looking for Symbol.  Now of course Symbol is not one
of the mapped named, so it does not find it.

So I thought, what happens if I alias Symbol to -adobe-symbol- which gets a
mention in the fonts loaded from the metric cache.  And to my great
surprise the alternatie work/not work stopped, and and it never works.
This may also explain why the IBM JRE did not work, as this is an area they
changed due to Double Byte far eastern character sets.

Now the reason why it is looking for Symbol is currently a mystery,
although in UnAlias it is merely looking at the LOGFONT object for the name
(I am not quite sure who supplies this).  Java does have multiple physical
fonts associated with single logical fonts, in order to create virtual
Unicode fonts.  But I am not sure this is what is happening here as there
does not appear to be any attempt to find the Arial font first in the cases
where it does not work.

The JREs by the say (both the Sun and IBM ones) work 100% reliably when
running this simple test case on a real Win98 system.

Anyone got any ideas?


Reply via email to