Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 266295 - dev-java/icedtea6-bin-1.4 uses unavailable default fonts
Summary: dev-java/icedtea6-bin-1.4 uses unavailable default fonts
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Java (show other bugs)
Hardware: All Linux
: High minor with 1 vote (vote)
Assignee: Java team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: icedtea-tracker 300769
  Show dependency tree
 
Reported: 2009-04-15 18:48 UTC by quazgar
Modified: 2013-07-04 18:20 UTC (History)
10 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
ugly font example for java (swing_font.png,11.35 KB, image/png)
2009-04-15 18:50 UTC, quazgar
Details
tvbrowser-ugly-font.png (tvbrowser-ugly-font.png,27.42 KB, image/png)
2013-07-04 18:20 UTC, Small_Penguin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description quazgar 2009-04-15 18:48:43 UTC
dev-java/icedtea6-bin-1.4 has very ugly default fonts, probably because it tries to use a font that doesn't exist on most systems.  At least the font configuration file /opt/icedtea6-bin-1.4/jre/lib/fontconfig.properties.src suggests that a font called "DejaVu LGC Sans" is used as the default font, whereas on most systems only the "normal" dejavu sans font is available.

It seems that other distros run into similar problems from time to time:
http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=160
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=495988

Maybe the configuration should be changed to a font that can be installed easily on a default gentoo system?
Comment 1 quazgar 2009-04-15 18:50:05 UTC
Created attachment 188482 [details]
ugly font example for java

An example of how a java swing application looks like with icedtea6-bin.
Comment 2 Andrew John Hughes 2009-05-28 21:19:15 UTC
Unlike Fedora, Ubuntu and SuSE, Gentoo uses the default fontconfig, as there is no special clause to handle Gentoo:

protected void setOsNameAndVersion() {

      super.setOsNameAndVersion();
      if (!osName.equals("Linux")) {
        return;
      }
      try {
        File f;
        if ((f = new File("/etc/lsb-release")).canRead()) {
         /* Ubuntu and (perhaps others) use only lsb-release.
         * Syntax and encoding is compatible with java properties.
         * For Ubuntu the ID is "Ubuntu".
         */
      Properties props = new Properties();
      props.load(new FileInputStream(f));
      osName = props.getProperty("DISTRIB_ID");
      osVersion = props.getProperty("DISTRIB_RELEASE");
      } else if ((f = new File("/etc/redhat-release")).canRead()) {
        osName = "RedHat";
        osVersion = getVersionString(f);
      } else if ((f = new File("/etc/SuSE-release")).canRead()) {
        osName = "SuSE";
        osVersion = getVersionString(f);
      } else if ((f = new File("/etc/turbolinux-release")).canRead()) {
        osName = "Turbo";  
        osVersion = getVersionString(f);
      } else if ((f = new File("/etc/fedora-release")).canRead()) {
        osName = "Fedora";
        osVersion = getVersionString(f);
      } else if ((f = new File("/etc/sun-release")).canRead()) {
        osName = "Sun";
        osVersion = getVersionString(f);
      } catch (Exception e) {
      if (SunGraphicsEnvironment.debugFonts) {
        Logger logger = Logger.getLogger("sun.awt.FontConfiguration");
        logger.warning("Exception identifying Linux distro.");
      }
    }

We could easily enough patch this to check /etc/gentoo-release and use our own dedicated fontconfig.
Comment 3 Vlastimil Babka (Caster) (RETIRED) gentoo-dev 2009-06-06 16:30:21 UTC
I'm not sure it's just the fontconfig files, I copied what we have in sun-jdk-1.6 (fontconfig.properties and .src and .bfc) and it still looks ugly, non-aliased etc.
Comment 4 jackieku 2010-01-07 01:02:44 UTC
Unlink sun-jdk, icedtea6 doesn't use X style font settings (e.g. -misc-dejavu sans-bold-r-normal--0-0-0-0-p-0-iso10646-1). It use the human readable font names instead (e.g. DejaVu Sans). But it seems the settings in fontconfig.properties doesn't use media-libs/fontconfig, and we need to give it the paths of the font files. I've tried to set sansserif.*, serif.*, etc in fontconfig.properties to "Sans Serif", "Serif", or "DejaVu Sans". It doesn't work at all. Ideally I think icedtea should support fontconfig and dump fontconfig.properties completely.
Comment 5 Nico R. 2010-01-15 01:54:34 UTC
I am hitting this bug for dev-java/icedtea6-1.6.2-r1 from java-overlay as well. (Should this go into a separate bug report?)

I did the following:
# umask 0022
# sed -e 's/ LGC / /' -e 's/_LGC_/_/' -e 's/-lgc//' -e 's/LGC//' /usr/lib/icedtea6/jre/lib/fontconfig.properties.src > /usr/lib/icedtea6/jre/lib/fontconfig.properties

This improved the situation for me (the newly generated file has higher priority than the existing .bfd file).

http://java.sun.com/javase/6/docs/technotes/guides/intl/fontconfig.html explains how fontconfig files are searched by the JRE.
Comment 6 Vadim Efimov 2010-01-27 18:57:18 UTC
For russian lang fonts unusable:
http://gallery.evadim.ru/d/443-2/2009-09-21-145031.png

java:
dev-java/icedtea6-1.6.2-r2  USE="javascript nsplugin -cacao -debug -doc -examples -nio2 -pulseaudio -systemtap -xrender -zero" 0 kB [1]

[1] /usr/local/layman/java-overlay
Comment 7 quazgar 2010-03-05 20:34:56 UTC
(In reply to comment #5)
> I did the following:
> # umask 0022
> # sed -e 's/ LGC / /' -e 's/_LGC_/_/' -e 's/-lgc//' -e 's/LGC//'
> /usr/lib/icedtea6/jre/lib/fontconfig.properties.src >
> /usr/lib/icedtea6/jre/lib/fontconfig.properties

Note that DejaVu (as installed by media-fonts/dejavu-2.29) doesn't have oblique serif font files, only "real" italics, so the above command should maybe rather be 

# sed -e 's/ LGC / /' -e 's/_LGC_/_/' -e 's/-lgc//' -e 's/LGC//'
 -e 's/Serif-Oblique/Serif-Italic/' -e 's/Serif-BoldOblique/Serif-BoldItalic/'
 fontconfig.properties.src >
 fontconfig.properties.new

Comment 8 Alexey Charkov 2010-05-03 19:18:35 UTC
I hitted an issue with missing glyphs for Cyrillic characters in sci-geosciences/josm. The problem seems to stem from the .src suffix in the fontconfig.properties files that Gentoo ebuilds install for icedtea. I copied fontconfig.Fedora.properties.src to fontconfig.properties, and now I see nice DejaVu fonts, including Cyrillic glyphs.
(Using dev-java/icedtea-6.1.8.0)
Comment 9 Andrew John Hughes 2010-08-11 21:44:11 UTC
A copy of the Fedora fontset is provided for Gentoo by a patch for 1.7.4 and 1.8.1 in java-overlay.  Please try this and report back.
Comment 10 Alexey Charkov 2010-08-11 23:54:46 UTC
(In reply to comment #9)
> A copy of the Fedora fontset is provided for Gentoo by a patch for 1.7.4 and
> 1.8.1 in java-overlay.  Please try this and report back.
> 

Works for me, thanks! (dev-java/icedtea-6.1.8.1-r1)
Comment 11 Vlastimil Babka (Caster) (RETIRED) gentoo-dev 2010-09-01 20:15:14 UTC
Released in icedtea6-bin-1.8.1-r1 as well.
Comment 12 Vadim Efimov 2010-09-05 20:09:21 UTC
(In reply to comment #9)
> A copy of the Fedora fontset is provided for Gentoo by a patch for 1.7.4 and
> 1.8.1 in java-overlay.  Please try this and report back.
> 

work for me too
Comment 13 Vlastimil Babka (Caster) (RETIRED) gentoo-dev 2010-10-19 18:36:18 UTC
A fixed version is now stable, closing.
Comment 14 Small_Penguin 2013-07-04 18:20:52 UTC
Created attachment 352616 [details]
tvbrowser-ugly-font.png

With icedtea-bin-6.1.12.5 (current stable in tree), I still have the problem as described in this bug, see attached screenshot of a tvbrowser dialog window. So it is not fixed. With the sun-jdk, there are no such problems. IIRC, icedtea-bin-7 shows the same problem.

Now that sun-jdk has become hard-masked, and icedtea-bin is considered the way to go, this is really not ideal. With sun-jdk unmasked and installed, icedtea-bin is still drawn in, as it is no longer optional which jvm one chooses.