JDK-8012351 : Bold fonts everywhere in GTK L&F on Ubuntu with JDK 7
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 7u40
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux_ubuntu
  • Submitted: 2013-04-16
  • Updated: 2014-07-29
  • Resolved: 2014-02-11
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
8u20Fixed 9 b06Fixed
Related Reports
Duplicate :  
Duplicate :  
Relates :  
Reportedly caused by Ubuntu fontconfig files missing in Java 7 installation. Users who copy the files from Java 6 report the problem disappears.

Ubuntu launchpad bug:
(last comment #44 explains the workaround)


related NetBeans bug:

If this is by design, can you please comment into the Ubuntu launchpad bug what is the reason and what the users need to do on their side if they do not like it? Thanks.

An off-list discussion following this email http://mail.openjdk.java.net/pipermail/2d-dev/2014-January/004111.html helped get to the root of this. The font management code ranks fonts : JRE fonts the highest, fonts used for the logical fonts next, other fonts below that. And once a font family has been established it wants to make sure we don't put a lower rank font in the family. With the hand-crafted fontconfig.properties files this has never been a problem but with the auto-generated files using libfontconfig, we are somewhat at the whim of how this enumerates the fonts. And the Ubuutu font itself is never ranked highly via that library but is explicitly and directly used by GTK So the Swing GTK L&F requests it. However since in some unlucky cases the Ubuntu Bold font made it high enough on the fontconfig list to make it into a logical font, albeit still around entry 20, the Ubuntu Regular did not. It seems that random things you install could provoke this by causing different font listings as shown by "fc-match -s sans". Also this explains why restoring a hand-crafted fontconfig.properties seems to fix it. A better fix is to change the logic for adding fonts to families to ensure we allow such lower-ranked fonts to join their rightful family ..

based on what I saw on a local desktop, it seems like this is a result of installing accelerated graphics drivers. In this case Catalyst was installed to accelerate the ATI card and then all text rendering across the entire desktop took on the blurriness, which was most noticeable in the Ubuntu font. I doubt its just ATI cards. See for example http://files.bortweb.com/how_to_fix_nvidia_blurry_fuzzy_screen_or_text.htm The compositing window manager and the AA mode in the driver are likely to blame. Since this affects the entire desktop, this isn't a Java bug and there isn't anything we can do about it.

set up jdk8 target to disappear from 7u40-untriaged dashboard

SQE is OK to defer this

7u40-defer-request justification : This bug should be deferred because : 1) Low impact - everything works, this is just about perceptions of what is expected. 2) Not clear its a bug - it could be just the way the font is. 3) Not likely to be a regression - more a new platform support issue 4) I can't reproduce it - probably due to a lack of available hardware. It doesn't reproduce on VirtualBox. Seems like it might need an actual system. Target this to 8 or later, but until I can reproduce (probably dependent on getting suitable desktop hardware) I can't make any promises as its not clear its even a bug.

I think "everywhere" is an exaggeration. I have never been able to reproduce this on my Virtual Box but I found someone with an Ubuntu 12.10 install and it is only occurring using the GTK L&F and the font being used there is "Ubuntu" which lives in the file "Ubuntu-R.ttf". This font is rendered thin even on the same box *except* when rendered on GTK L&F components. The font used by the GTK L&F is picked up by querying the GTK theme engine or a Gnome desktop property. So I can't see how it has anything to do with fontconfig files. That part is puzzling. My guess is that the Unity GTK Engine is doing some compositing which is having this effect.

BTW I presume you *are* using Oracle JDK, not IcedTea ??

That's the same font I get. So I'm puzzled. Trial and error suggests that the panel in your attached screen shot is rendered using 15 pixel "Ubuntu Bold". Is netbeans configured to use the platform L&F (ie GTK L&F) ? What does it look like in SwingSet2 if you switch to GTK L&F. My fonts are regular weight - not bold - but maybe you changed your settings? But this would not explain why installing a font properties file cured it. Please attach any files found under ~/.java/fonts/<YOUR-JDK-VERSION>/ It should be of the form fcinfo-1-<...>.properties

marian@marian-nb:~$ fc-match sans DejaVuSans.ttf: "DejaVu Sans" "Book"

Marian who is reproducing the problem on his machine will be able to clarify that. I included him on this bug.

It works fine for me on my VirtualBox hosted 7u21. Netbeans likely uses the default dialog font what does "fc-match sans" show on your system ? That's what it would map to in the absence of a fontconfig file.