-
Bug
-
Resolution: Fixed
-
P3
-
6.0, 5.0, 7, 8, 9
-
b155
-
x86
-
windows_xp
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8174648 | 10 | Philip Race | P3 | Resolved | Fixed | b01 |
FULL PRODUCT VERSION :
1.5.0_01-b08
ADDITIONAL OS VERSION INFORMATION :
Windows XP SP2
A DESCRIPTION OF THE PROBLEM :
In Java 1.4 and earlier it was possible to load TrueType fonts with the java.awt.Font.createFont() method that contained only an apple cmap (platform 1, encoding 0). Ditto for reading the the names table.
Now, in 1.5, the sun.font.TrueType class specifically checks for the platform ID of the *first* CMAP table and if it's not 3, aborts.
Most fonts have several cmap tables - the one we're testing has 1/0 for the first table, and the expected 3/1 for the second table. The correct behaviour is to scan all the cmap tables looking for a 3/1 table. It should also accept a 1/0 table as backup, as there is a well-defined mapping from Apples Roman encoding to Unicode. In fact one of your engineers says that it did just that back in 1.3.1 - see bug 4517869.
Second problem, same as the first. The "name" table is required to have a name in Microsofts Unicode encoding, or it won't load. Again it should accept a font with Apple encodings.
I know most fonts these days have MS format name tables, but that's not the point - the most important aspect of this is that it worked in 1.4 and doesn't now.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Given any font where the first CMAP does not have platform=3, encoding=1, and/or a NAME table that doesn't contain any names with platform=3, encoding=1:
Font.createFont(Font.TRUETYPE, fontfileinputstream);
dies with "No font or font-family name". The message is similar for the CMAP table.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Font should load correctly as for 1.4.2
REPRODUCIBILITY :
This bug can be reproduced always.
CUSTOMER SUBMITTED WORKAROUND :
Hmph. We edited the font with a hex editor to set the first CMAP to "3/0" and the entries in the names table to "3/0". Not really a solution.
###@###.### 2005-2-23 18:00:21 GMT
1.5.0_01-b08
ADDITIONAL OS VERSION INFORMATION :
Windows XP SP2
A DESCRIPTION OF THE PROBLEM :
In Java 1.4 and earlier it was possible to load TrueType fonts with the java.awt.Font.createFont() method that contained only an apple cmap (platform 1, encoding 0). Ditto for reading the the names table.
Now, in 1.5, the sun.font.TrueType class specifically checks for the platform ID of the *first* CMAP table and if it's not 3, aborts.
Most fonts have several cmap tables - the one we're testing has 1/0 for the first table, and the expected 3/1 for the second table. The correct behaviour is to scan all the cmap tables looking for a 3/1 table. It should also accept a 1/0 table as backup, as there is a well-defined mapping from Apples Roman encoding to Unicode. In fact one of your engineers says that it did just that back in 1.3.1 - see bug 4517869.
Second problem, same as the first. The "name" table is required to have a name in Microsofts Unicode encoding, or it won't load. Again it should accept a font with Apple encodings.
I know most fonts these days have MS format name tables, but that's not the point - the most important aspect of this is that it worked in 1.4 and doesn't now.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Given any font where the first CMAP does not have platform=3, encoding=1, and/or a NAME table that doesn't contain any names with platform=3, encoding=1:
Font.createFont(Font.TRUETYPE, fontfileinputstream);
dies with "No font or font-family name". The message is similar for the CMAP table.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Font should load correctly as for 1.4.2
REPRODUCIBILITY :
This bug can be reproduced always.
CUSTOMER SUBMITTED WORKAROUND :
Hmph. We edited the font with a hex editor to set the first CMAP to "3/0" and the entries in the names table to "3/0". Not really a solution.
###@###.### 2005-2-23 18:00:21 GMT
- backported by
-
JDK-8174648 TrueType Fonts which have only Apple platform names cannot be loaded
-
- Resolved
-