-
Enhancement
-
Resolution: Fixed
-
P4
-
5.0
-
None
-
b53
-
generic
-
generic
The Font.createFont() APIs returns a Font instance which must be used
via deriveFont APIs to get new instances and sizes.
ie all uses of it must look like
try {
Font f = Font.createFont(instream, Font.TRUETYPE_FONT);
f = f.deriveFont(12f);
graphics.setFont(f);
} catch (FontFormatException e) {
}
and can not(!) be like
try {
Font f = Font.createFont(instream, Font.TRUETYPE_FONT);
f = new Font(f.getFontName(), Font.PLAIN, 12);
graphics.setFont(f);
} catch (FontFormatException e) {
}
Essentially these fonts live in a private name space.
There are use cases where this is limiting.
If you are utilising a package which reads font string names from some
source and uses new Font(..) with that name (or ill-advisedly uses getFont)
then this requires that the Font be an installed Font and not one created
via the createFont API.
This RFE requests that there be a supported mechanism for Fonts loaded
via createFont to be available via the Font construction APIs.
###@###.### 2005-03-24 19:08:27 GMT
via deriveFont APIs to get new instances and sizes.
ie all uses of it must look like
try {
Font f = Font.createFont(instream, Font.TRUETYPE_FONT);
f = f.deriveFont(12f);
graphics.setFont(f);
} catch (FontFormatException e) {
}
and can not(!) be like
try {
Font f = Font.createFont(instream, Font.TRUETYPE_FONT);
f = new Font(f.getFontName(), Font.PLAIN, 12);
graphics.setFont(f);
} catch (FontFormatException e) {
}
Essentially these fonts live in a private name space.
There are use cases where this is limiting.
If you are utilising a package which reads font string names from some
source and uses new Font(..) with that name (or ill-advisedly uses getFont)
then this requires that the Font be an installed Font and not one created
via the createFont API.
This RFE requests that there be a supported mechanism for Fonts loaded
via createFont to be available via the Font construction APIs.
###@###.### 2005-03-24 19:08:27 GMT