Bug 478480

Summary: TextLayout constructor depends on fonts to not throw Error
Product: Red Hat Enterprise Linux 5 Reporter: Noa Resare <noa>
Component: java-1.6.0-openjdkAssignee: jiri vanek <jvanek>
Status: CLOSED NOTABUG QA Contact: BaseOS QE <qe-baseos-auto>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.3CC: dbhole, ozizka, patrickm, ptisnovs
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-11-16 10:14:52 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
a short test program calling the TextLayout constructor with default arguments
none
Proposed solution none

Description Noa Resare 2008-12-30 20:22:49 UTC
Created attachment 327976 [details]
a short test program calling the TextLayout constructor with default arguments

Description of problem:
I use apache batik to render svg files into png files on a web server. When using openjdk my rendering fails due to the use of java.awt.font.TextLayout whose constructor expects system fonts.

Version-Release number of selected component (if applicable):
java-1.6.0-openjdk-1.6.0.0-1.0.b12.el5.2

How reproducible:
always

Steps to Reproduce:
1. Verify that 'rpm -qa|grep fonts' turns out empty, and there are no fonts on your el5 system
2. Compile and run the attached program.
3.
  
Actual results:
An 107 lines long stack trace starting with

Exception in thread "main" java.lang.Error: Probable fatal error:No fonts found.
        at sun.font.FontManager.getDefaultPhysicalFont(FontManager.java:1088)


Expected results:
Successful execution of the program.

Additional info:
when running it using jre-1.6.0_11-fcs from java.sun.com or when running the openjdk version on a workstation with full X/gnome setup the test program executes without any errors

Comment 1 Noa Resare 2009-04-02 13:19:45 UTC
This problem still persists in java-1.6.0-openjdk-1.6.0.0-0.25.b09.el5 from the recent 5.3 release

I have found that installing 'liberation-fonts' solves this problem, so adding a dependency on that package seems like a simple and effective solution.

Comment 2 man lung wong 2010-07-08 18:06:33 UTC
I can verified that by adding:

Require: liberation-fonts 

to openjdk spec file does solve this bug.

Man Lung Wong

Comment 3 Pavel Tisnovsky 2010-07-09 15:37:07 UTC
Martin Matejovic have created new OpenJDK RPMs which now properly check if liberation-fonts is installed. I'm going to run our tests against these new unofficial RPMs.

Comment 6 Paballo 2010-07-30 08:09:35 UTC
Created attachment 435492 [details]
Proposed solution

Try this Patch

Comment 8 Ondřej Žižka 2010-10-26 23:19:56 UTC
*** Bug 647054 has been marked as a duplicate of this bug. ***

Comment 9 Ondřej Žižka 2010-10-26 23:22:27 UTC
Reproduced with IcedTea 1.7.4 - see the duplicate above.

Comment 10 Ondřej Žižka 2010-10-29 14:20:24 UTC
Linked from https://jira.jboss.org/browse/JBPAPP-5338

Comment 11 jiri vanek 2010-11-16 10:14:52 UTC
I don't think this is bug. How can you expect correct behavior of text components when you remove all fonts?