Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 4499991
Votes 0
Synopsis Regression:monospaced italic font is not monospaced any more in the beta2
Category java:classes_2d
Reported Against merlin-beta2
Release Fixed 1.4(merlin-beta3)
State 10-Fix Delivered, bug
Priority: 2-High
Related Bugs
Submit Date 05-SEP-2001
Description
  xxxxx@xxxxx   2001-09-05

J2SE Version (please include all output from java -version flag):
java version "1.4.0-beta2"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta2-b77)
Java HotSpot(TM) Client VM (build 1.4.0-beta2-b77, mixed mode)


Does this problem occur on J2SE 1.3?  Yes / No (pick one)
No. (It works fine on build 74)

Operating System Configuration Information (be specific):
Redhat Linux 7.1, very likely to occur on other Linux flavors as well.
XFree 4.0.2

Hardware Configuration Information (be specific):
Athlon 1GHz, 256 MB RAM, Ati graphics adapter

Bug Description:
The monospaced italic font is not monospaced any more in the beta2 
(build77). It was working perfectly up to CAP build 74.
This regression bug was introduced since build 75.


Steps to Reproduce (be specific):

Run the attached Java program(FontMetricsTest.java) on the JDK 1.4
beta2 on Linux to reproduce.

Test program: (FontMetricsTest.java)
------------------------------------------
import javax.swing.*;
import javax.swing.event.*;
import java.awt.*;
import java.awt.event.*;
import java.util.*;
import java.io.*;


/**
 * This application shows off that the italic monospaced font is no longer monospaced in the JDK 1.4beta2 on Linux
 *
 */


public class FontMetricsTest
{
	private static final int[] fontStyles = { Font.PLAIN, Font.BOLD, Font.ITALIC, Font.BOLD | Font.ITALIC };

	public static void main(String[] args)
	{
		FontMetrics italicMonospacedFontMetrics = Toolkit.getDefaultToolkit().getFontMetrics(new Font("Monospaced", Font.ITALIC, 14));
		
		System.out.println("width of an i: "+italicMonospacedFontMetrics.stringWidth("i"));
		System.out.println("width of an m: "+italicMonospacedFontMetrics.stringWidth("m"));
	}
}


  xxxxx@xxxxx   2001-09-10

more info passed by submitter:

This bug is present for the bolditalic monospaced font as well (Font.BOLD |
Font.ITALIC).
Work Around
N/A
Evaluation
The Lucida oblique fonts were removed from the distribution.
The intention was that when an application requested an italic version of
one of the families for these oblique fonts that algorithmic styling would
kick in and the result would be the same and we would not incur download costs.
But on Linux these fonts are specified in the font.properties file to be used
for italic versions of the composite fonts. This causes problems for both
AWT and 2D. AWT would never be able to use the algorithmic styling on the fly
as it exclusively gets its fonts from the Xserver, and the XServer will not do
this. And since the required font was no longer present, it would get some
substitute which is a function of the algoritjm employed by AWT to search, and
the fonts available on the system.
2D would also not get the correct font, since the algorithm employed to
perform styling of composite fonts determined the need based on the
font.properties file specifying the exact same XLFD for plain and styled
versions, from which it inferred that the font was in fact not styled and
algorithmic styling would need to be invoked. This broke down because the XLFD
was not the same in this case - the oblique fonts were specified for the italic
styles of the composite font. Changing the font properties files to specify
the regular versions would have worked for 2D, but not for AWT as it could
not take advantage of the algorithmic styling.

  xxxxx@xxxxx   2001-09-25
============================
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang