Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4803825

AWT and Swing Toolkits don't support transformed fonts on Components.

    Details

    • Type: Bug
    • Status: Open
    • Priority: P5
    • Resolution: Unresolved
    • Affects Version/s: 1.1.8
    • Fix Version/s: None
    • Component/s: client-libs
    • Labels:
    • Subcomponent:
    • Understanding:
      Fix Understood
    • CPU:
      x86
    • OS:
      windows_2000

      Description

      Name: jl125535 Date: 01/15/2003


      FULL PRODUCT VERSION :
      java version "1.4.1"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1-b21)
      Java HotSpot(TM) Client VM (build 1.4.1-b21, mixed mode)

      java version "1.4.2-beta"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2-beta-b12)
      Java HotSpot(TM) Client VM (build 1.4.2-beta-b12, mixed mode)

      FULL OPERATING SYSTEM VERSION : Windows 2000


      A DESCRIPTION OF THE PROBLEM :
      Constructor java.awt.Font(String....) allows a negative font size.
      I think it should throw an exception or assume a default size at worst/
      For now, components with a negative font size simply do not appear.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Start provided code.

      The window will be completely empty. Switching the font size to 1 will result
      in a tiny label appearing.


      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import java.awt.Font;
      import javax.swing.JFrame;
      import javax.swing.JLabel;

      public class FontTest extends JFrame {
      public FontTest() {
      Font f = new Font("Dialog", Font.PLAIN, -1);
      System.out.println("FontSize: "+f.getSize());
      JLabel label = new JLabel("Hello");
      label.setFont(f);
      getContentPane().add(label);
      setSize(200,200);
      setVisible(true);
      }

      public static void main(String[] args) {
      new FontTest();
      }
      }

      ---------- END SOURCE ----------
      (Review ID: 164847)
      ======================================================================

        Attachments

          Activity

            People

            • Assignee:
              osemenovsunw Oleg Semenov (Inactive)
              Reporter:
              jleesunw Jon Lee (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Imported:
                Indexed: