Bug 478480 - TextLayout constructor depends on fonts to not throw Error
Summary: TextLayout constructor depends on fonts to not throw Error
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: java-1.6.0-openjdk
Version: 5.3
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
: ---
Assignee: jiri vanek
QA Contact: BaseOS QE
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-12-30 20:22 UTC by Noa Resare
Modified: 2010-11-24 14:19 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-11-16 10:14:52 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
a short test program calling the TextLayout constructor with default arguments (470 bytes, text/x-java)
2008-12-30 20:22 UTC, Noa Resare
no flags Details
Proposed solution (585 bytes, patch)
2010-07-30 08:09 UTC, Paballo
no flags Details | Diff

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?


Note You need to log in before you can comment on or make changes to this bug.