JDK-4071449 : JDK 1.1 Solaris: bold fonts not bold for point size less than 12
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 1.1.3
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: solaris_2.5.1
  • CPU: sparc
  • Submitted: 1997-08-13
  • Updated: 1998-05-06
  • Resolved: 1998-05-06
Related Reports
Duplicate :  
Description
JDK 1.1 introduced the fonts.properties file

In that file we have templates indicating the  system fonts to be used 
when a Java font is requested.

On Solaris the specifications look like

helvetica.bold.0=-linotype-helvetica-bold-r-normal-sans-*-%d-*-*-p-*-iso8859-1
and also
sansserif.bold.0=-linotype-helvetica-bold-r-normal-sans-*-%d-*-*-p-*-iso8859-1

This is the equivalent of requesting Helvetica bold, and the %d is replaced
by your point size multiplied by 10.

For font sizes >= 12 this font looks fine.

however this particular font does not look at all bold when a point size
of 10 is specified. It is slightly wider spaced than the plain font, but not
at all bolder.

Thus it is poor choice, especially since this creates a regression from
JDK 1.0.2 and  the built in JDK runtime default  of 

-adobe-helvetica-bold-r-*-*-10-*-*-*-*-*-iso8859-1

for the same request.

If you use either JDK 1.0.2, or remove the fonts.properties file from
JDK 1.1 you do indeed get a bold font

The fonts being used can be examined quite simply by running these
commands.

xfd -fn "-linotype-helvetica-bold-r-normal-sans-*-120-*-*-p-*-iso8859-1"
xfd -fn "-linotype-helvetica-bold-r-normal-sans-*-100-*-*-p-*-iso8859-1"
xfd -fn "-linotype-helvetica-bold-r-normal-sans-*-80-*-*-p-*-iso8859-1"
xfd -fn "-adobe-helvetica-bold-r-*-*-10-*-*-*-*-*-iso8859-1"
xfd -fn "-linotype-helvetica-bold-o-normal-sans-*-100-*-*-p-*-iso8859-1"


Note that I think all the bold variants of linotype are equally poor
for points sizes less tnan 12 . eg bold italic too.

// FontsFrame.java
import java.awt.*;

public class FontsFrame extends Frame {

  public static void main(String[] args) {
     FontsFrame ff = new FontsFrame();
     ff.resize(350,150);
     ff.show();
  }

  public void paint(Graphics g) {
     Font f;

     f = new Font("Helvetica", Font.PLAIN, 10);
     g.setFont(f);
     g.drawString("This is Helvetica 10 plain", 20, 40);

     f = new Font("Helvetica", Font.BOLD, 10);
     g.setFont(f);
     g.drawString("This is Helvetica 10 bold", 20, 60);

     f = new Font("Helvetica", Font.BOLD, 12);
     g.setFont(f);
     g.drawString("This is Helvetica 12 bold", 20, 80);

     f = new Font("Courier", Font.PLAIN, 10);
     g.setFont(f);
     g.drawString("This is Courier 10 plain", 180, 40);

     f = new Font("Courier", Font.BOLD, 10);
     g.setFont(f);
     g.drawString("This is Courier 10 bold", 180, 60);

     f = new Font("Courier", Font.BOLD, 12);
     g.setFont(f);
     g.drawString("This is Courier 12 bold", 180, 80);
 }
}


Name: rrT76497			Date: 05/06/98

Suseendran May 06,98. This bug is already in db.
Unable reproduce in Solaris 2.5, JDK1.2beta3


======================================================================

Comments
WORK AROUND I delevering a Java app, include your own version of JDK in which you have repaired the fonts.properties file
11-06-2004

SUGGESTED FIX Use the adobe font
11-06-2004

PUBLIC COMMENTS With JDK 1.1 on Solaris, bold fonts not bold for point size less than 12 The problem is that the font chosen does not render bold for small point sizes, and is different than the same request under JDK 1.0.2
10-06-2004