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)
======================================================================