Java 1.5 and system fonts  
Author Message
Edsko de Vries





PostPosted: 2005-11-28 22:58:00 Top

java-programmer, Java 1.5 and system fonts Hi,

I don't know if this is the right group to ask this (if not, where
should I post?), but here we go: I have two machines, both running
Debian, and installed the official Sun JDK (1.5.0_05) on both. Here's
the question: on one machine, Java applications find all fonts that
have been installed on the system; on the other, Java applications only
find a very small set of standard fonts.

Obviously, there must a difference between the two systems (they are
certainly not identical, although they are pretty similar) -- but I
can't think what it could be. It is certainly not a configuration in
the JDK itself, because the two installations on both machines are
identical (I even diff-ed both directories to be sure :-) What I don't
know is how to make fonts available to the JVM - or, what I have done
wrong/correct on either machine. I know the fonts have been installed,
because running Gimp (for instance) on either machine finds all the
fonts. The fontconfig configuration in /etc/fonts is also identifical
as far as I can see (I don't know if that has anything to do with
anything, but I checked anyway :) Also, both systems are running defoma
(the Debian font manager), but I don't know if that can help in any way
here.

Any pointers or hints would be appreciated,

Thanks,

Edsko

 
Roedy Green





PostPosted: 2005-11-29 0:22:00 Top

java-programmer >> Java 1.5 and system fonts On 28 Nov 2005 06:58:08 -0800, "Edsko de Vries" <email***@***.com>
wrote, quoted or indirectly quoted someone who said :

>Obviously, there must a difference between the two systems (they are
>certainly not identical, although they are pretty similar)

Let me speculate. Let as say machine A is much older than machine B,
and has gradually through a series of many updates reached the same
level of OS as machine B.

Let us say that fonts on A were installed long ago, say before unicode
support was standard. They have remained undisturbed.

To test my hypothesis, check the dates and lengths of the fonts on
machine A and B. If they differ, you could try uninstalling and
reinstalling fonts on machine A.

If that did not work, if you were prepared to live dangerously, do a
full backup, then copy the B machine fonts into machine A.

If that did not work, you could reformat the disk, install your OS
from scratch, and reinstall apps and restore data.
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
 
Edsko de Vries





PostPosted: 2005-12-1 17:45:00 Top

java-programmer >> Java 1.5 and system fonts Hi,

Thanks for your reply. Part of your speculation is correct, part isn't.
It is correct that one machine is much older than the other, and it is
true that it does not work on the older machine, but does work on the
newer machine - however, they have both recently been fully reinstalled
(from scratch) from the exact same Debian installation disks (a version
of Sarge, just before it was upgraded to "stable"). In particular, the
fonts on both systems come from that installer. So, unfortunately, I
don't think that this is the problem.

Any other suggestions are appreciated ;)

Edsko

 
 
Roedy Green





PostPosted: 2005-12-1 18:22:00 Top

java-programmer >> Java 1.5 and system fonts On 1 Dec 2005 01:45:12 -0800, "Edsko de Vries" <email***@***.com>
wrote, quoted or indirectly quoted someone who said :

>Thanks for your reply. Part of your speculation is correct, part isn't.
>It is correct that one machine is much older than the other, and it is
>true that it does not work on the older machine, but does work on the
>newer machine - however, they have both recently been fully reinstalled
>(from scratch) from the exact same Debian installation disks (a version
>of Sarge, just before it was upgraded to "stable"). In particular, the
>fonts on both systems come from that installer. So, unfortunately, I
>don't think that this is the problem.

If that is true, then what can be different? Pretty well only thing
that could be relevant is the video card and its drivers. Try
borrowing the video card from the new machine and installing it and
see if that fixes the problem.
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
 
 
Nigel Wade





PostPosted: 2005-12-2 21:50:00 Top

java-programmer >> Java 1.5 and system fonts Edsko de Vries wrote:

> Hi,
>
> Thanks for your reply. Part of your speculation is correct, part isn't.
> It is correct that one machine is much older than the other, and it is
> true that it does not work on the older machine, but does work on the
> newer machine - however, they have both recently been fully reinstalled
> (from scratch) from the exact same Debian installation disks (a version
> of Sarge, just before it was upgraded to "stable"). In particular, the
> fonts on both systems come from that installer. So, unfortunately, I
> don't think that this is the problem.
>
> Any other suggestions are appreciated ;)
>
> Edsko

I'm not exactly where Java gets its font definitions from. If it queries the X
font server for a list of fonts which are available there may be some
difference in the list which it returns. Try running xlsfonts on both systems
to see what they have to say.

I have a nagging recollection that Java has it's own fonts to try to make it as
similar in cross-platform configurations as possible, but I might well be
wrong.

--
Nigel Wade, System Administrator, Space Plasma Physics Group,
University of Leicester, Leicester, LE1 7RH, UK
E-mail : email***@***.com
Phone : +44 (0)116 2523548, Fax : +44 (0)116 2523555
 
 
Thomas Weidenfeller





PostPosted: 2005-12-3 0:40:00 Top

java-programmer >> Java 1.5 and system fonts Nigel Wade wrote:
> I have a nagging recollection that Java has it's own fonts to try to make it as
> similar in cross-platform configurations as possible, but I might well be
> wrong.

Since some time Java comes with an own set of Lucida TrueType font files
in jre/lib/fonts. But

1) Not each Java VM uses these Lucida fonts as default for the Java
system fonts,. So one has to explicitly request the Lucida fonts instead
of relying on the defaults if one wants to make sure to get them on all
platforms, and

2) different VMs use different font renderers. Different font renderers
interpret these files differently. E.g. for a long time Sun's build-in
renderer in the VM ignored any hints in TrueType font files.

/Thomas
--
The comp.lang.java.gui FAQ:
ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/computer-lang/java/gui/faq
http://www.uni-giessen.de/faq/archiv/computer-lang.java.gui.faq/
 
 
Roedy Green





PostPosted: 2005-12-3 2:33:00 Top

java-programmer >> Java 1.5 and system fonts On Fri, 02 Dec 2005 13:49:43 +0000, Nigel Wade <email***@***.com>
wrote, quoted or indirectly quoted someone who said :

>I have a nagging recollection that Java has it's own fonts to try to make it as
>similar in cross-platform configurations as possible, but I might well be
>wrong.

Java has a few fonts of its own. Look in the jre/lib/fonts
subdirectory. The fonts there sare available only to Java. They
include Sun's version of Lucida Bright, Lucida Sans and Lucida Sans
Typewriter.

For more details see http://mindprod.com/jgloss/font.html
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
 
 
Edsko de Vries





PostPosted: 2005-12-15 1:58:00 Top

java-programmer >> Java 1.5 and system fonts Sorry for the delay. Yeah, that's exactly what I'm trying to find out:
where Java gets its font definitions from. I tried xlsfonts on both
machines, and they return the exact same list of fonts; so that cannot
be the problem either :-(

This is a real puzzler..

Edsko