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

JCK regression for Font.getFamily()

    XMLWordPrintable

Details

    • 2d
    • sparc
    • solaris_2.5

    Description



      Name: dsC58869 Date: 05/15/98



      The following JCK1.2beta2 tests fail under jdk1.2beta4:
      api/java_awt/Font/manual.html#GetFamily

      This is a compatibility problem for jdk1.2beta4.
      The tests do not fail under jdk1.2beta3, jdk1.1.7.

      The reason is the incompatible API change:
      Method Font.getFamily() returns the 'awt.font.fontname' property to provide
      family name in jdk1.1.x, jdk1.2beta3. In jdk1.2beta4 it returns empty string.

      ==== Here is the test demonstrating the bug ====
      import java.awt.Font;

      public class TestFont0001 {
        public static void main(String[] args) {
          Font f=new Font("SomeName", Font.PLAIN, 12);
          System.out.println(f);
          System.out.println("Family: " + f.getFamily());
        }
      }

      ==== Here is the output of the test ====
      ----- (JDK-1.2beta4) -----
      (sda@spear@/home/sda/temp/tests)41%java -fullversion
      java full version "JDK-1.2beta4-F"
      (sda@spear@/home/sda/temp/tests)42%javac TestFont0001.java
      (sda@spear@/home/sda/temp/tests)43%java TestFont0001
      JAVA2D_USEPLATFORMFONT not set
      Disabling platform fonts
      java.awt.Font[family=,name=SomeName,style=plain,size=12]
      Family:
      ^C(sda@spear@/home/sda/temp/tests)44%

      ----- (JDK-1.2beta3) -----
      (sda@spear@/home/sda/temp/tests)118%java -fullversion
      java full version "JDK-1.2beta3-N"
      (sda@spear@/home/sda/temp/tests)119%javac TestFont0001.java
      (sda@spear@/home/sda/temp/tests)120%
      java TestFont0001
      java.awt.Font[family=SomeName,name=Times Roman,style=plain,size=12]
      Family: SomeName

      ----- Here is the output of the test (JDK1.1.7) -----
      (sda@spear@/home/sda/temp/tests)101%java -fullversion
      java full version "JDK1.1.7d3"
      (sda@spear@/home/sda/temp/tests)102%javac TestFont0001.java
      (sda@spear@/home/sda/temp/tests)103%java TestFont0001
      java.awt.Font[family=SomeName,name=SomeName,style=plain,size=12]
      Family: SomeName
      ^C(sda@spear@/home/sda/temp/tests)104%


      ======================================================================
       Justification:
      JCK regression.

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

      Attachments

        Issue Links

          Activity

            People

              pcharltosunw Paul Charlton (Inactive)
              dsilaev Dmitri Silaev
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: