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

RFE: create Font directly from File: java.awt.Font.create(int fontFormat, File)

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.4.0
    • client-libs
    • 2d
    • generic
    • generic



      Name: bsT130419 Date: 10/08/2001


      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)


      java.awt.Font has the following method:
      static Font createFont(int fontFormat, InputStream fontStream)

      If the font is packed in a JAR, this is a convenient signature.
      However, often a font exists as a file, or one can cache the font as a file
      (i.e., would cache if advantageous).

      In the current implementation, createFont(InputStream) always fully reads the
      InputStream to create a File. If the font already exists as a file, a new
      createFont(int fontFormat, File) method would be:
      * slightly more convenient in this case
      * much more efficient - vs creating a new file when a file already exists.
      I have two applications that need to create many fonts fast, so speed is
      important.
      * trivial to implement - just a method definition line and a call from
      near the end of the existing createFont to the new one
      * free of a temporary file, which requires write permission,
      and needs to be deleted later, which has led to a bug.

      The disadvantage would be an increase in the size of the API by one method.
      (Review ID: 133277)
      ======================================================================

            prr Philip Race
            bstrathesunw Bill Strathearn (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: