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

awt.Font.getName and awt.Font.getFamily are identical (1.1.x)

XMLWordPrintable

    • 2d
    • generic
    • generic



      Name: dgC58589 Date: 11/18/97


      The documentation says of Font.getFamily
      "Gets the platform specific family name of the font."
      I assume that this should be something like
      "Times New Roman" or "Ariel" or MS Mincho etc.
      Insted what I get is the Java logical name.
      The following program demonstrates the problem:
      import java.io.*;
      import java.awt.*;


      class t{
          public static void main(String[] argv){
      Font f;

      String[] fontlist = Toolkit.getDefaultToolkit().getFontList();
      System.err.println(fontlist.length+" Fonts defined");

      for (int i = 0; i< fontlist.length; i++) {
      System.err.println("Font "+fontlist[i]);
      f = new Font(fontlist[i],Font.PLAIN,12);
      System.err.println("Family "+f.getFamily());
      System.err.println("Name "+f.getName());
      }
      System.exit(1);
          }
      }
      (Review ID: 19788)
      ======================================================================

            Unassigned Unassigned
            dgrahamcsunw David Graham-cumming (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: