-
Enhancement
-
Resolution: Fixed
-
P4
-
6u26
-
b114
-
x86
-
windows_7
A DESCRIPTION OF THE REQUEST :
Interface to createFont() returns a single Font object. In the case where the font file sent to createFont() is a collection (TTC for instance), the Font that will be returned is the first font in the collection. There is currently no public API support allowing access to any other font in the collection. There is code support to access these fonts within the sun.font package but it is not made publicly accessible to developpers.
Possible solutions would be extending createFont by providing an index (this is what is used internally in sun.font) and of course a way to determine total number of fonts in file, making createFont return a Font[] instead of a Font, or providing a different API that would allow either of these solutions without needing to change createFont.
JUSTIFICATION :
Our product necessitates access to external font ressources provided by a central font server. Currently we cannot provide fully support for many font ressources, mostly including Asian fonts that tend to be provided in large Truetype collection files.
CUSTOMER SUBMITTED WORKAROUND :
When we need to access a TrueType collection font ressource not currently installed on the system, we're currently parsing the offsets to each font within TTC collections and generating new font files for each individual font by simply altering the offsets table. This is pretty wasteful and is not an acceptable solution in the long term.
Interface to createFont() returns a single Font object. In the case where the font file sent to createFont() is a collection (TTC for instance), the Font that will be returned is the first font in the collection. There is currently no public API support allowing access to any other font in the collection. There is code support to access these fonts within the sun.font package but it is not made publicly accessible to developpers.
Possible solutions would be extending createFont by providing an index (this is what is used internally in sun.font) and of course a way to determine total number of fonts in file, making createFont return a Font[] instead of a Font, or providing a different API that would allow either of these solutions without needing to change createFont.
JUSTIFICATION :
Our product necessitates access to external font ressources provided by a central font server. Currently we cannot provide fully support for many font ressources, mostly including Asian fonts that tend to be provided in large Truetype collection files.
CUSTOMER SUBMITTED WORKAROUND :
When we need to access a TrueType collection font ressource not currently installed on the system, we're currently parsing the offsets to each font within TTC collections and generating new font files for each individual font by simply altering the offsets table. This is pretty wasteful and is not an acceptable solution in the long term.
- csr of
-
CCC-8055463 Need public API allowing full access to font collections in Font.createFont()
-
- Closed
-