jdk/src/share/classes/sun/font/TrueTypeFont.java
changeset 23288 b7183846db97
parent 22584 eed64ee05369
child 25207 7bcb957cb011
equal deleted inserted replaced
23287:c0f8cdafef56 23288:b7183846db97
   288                 FontUtilities.getLogger().info("open TTF: " + platName);
   288                 FontUtilities.getLogger().info("open TTF: " + platName);
   289             }
   289             }
   290             try {
   290             try {
   291                 RandomAccessFile raf = (RandomAccessFile)
   291                 RandomAccessFile raf = (RandomAccessFile)
   292                 java.security.AccessController.doPrivileged(
   292                 java.security.AccessController.doPrivileged(
   293                     new java.security.PrivilegedAction() {
   293                     new java.security.PrivilegedAction<Object>() {
   294                         public Object run() {
   294                         public Object run() {
   295                             try {
   295                             try {
   296                                 return new RandomAccessFile(platName, "r");
   296                                 return new RandomAccessFile(platName, "r");
   297                             } catch (FileNotFoundException ffne) {
   297                             } catch (FileNotFoundException ffne) {
   298                             }
   298                             }
  1544 
  1544 
  1545     /* This duplicates initNames() but that has to run fast as its used
  1545     /* This duplicates initNames() but that has to run fast as its used
  1546      * during typical start-up and the information here is likely never
  1546      * during typical start-up and the information here is likely never
  1547      * needed.
  1547      * needed.
  1548      */
  1548      */
  1549     protected void initAllNames(int requestedID, HashSet names) {
  1549     protected void initAllNames(int requestedID, HashSet<String> names) {
  1550 
  1550 
  1551         byte[] name = new byte[256];
  1551         byte[] name = new byte[256];
  1552         ByteBuffer buffer = getTableBuffer(nameTag);
  1552         ByteBuffer buffer = getTableBuffer(nameTag);
  1553 
  1553 
  1554         if (buffer != null) {
  1554         if (buffer != null) {
  1582             }
  1582             }
  1583         }
  1583         }
  1584     }
  1584     }
  1585 
  1585 
  1586     String[] getAllFamilyNames() {
  1586     String[] getAllFamilyNames() {
  1587         HashSet aSet = new HashSet();
  1587         HashSet<String> aSet = new HashSet<>();
  1588         try {
  1588         try {
  1589             initAllNames(FAMILY_NAME_ID, aSet);
  1589             initAllNames(FAMILY_NAME_ID, aSet);
  1590         } catch (Exception e) {
  1590         } catch (Exception e) {
  1591             /* In case of malformed font */
  1591             /* In case of malformed font */
  1592         }
  1592         }
  1593         return (String[])aSet.toArray(new String[0]);
  1593         return aSet.toArray(new String[0]);
  1594     }
  1594     }
  1595 
  1595 
  1596     String[] getAllFullNames() {
  1596     String[] getAllFullNames() {
  1597         HashSet aSet = new HashSet();
  1597         HashSet<String> aSet = new HashSet<>();
  1598         try {
  1598         try {
  1599             initAllNames(FULL_NAME_ID, aSet);
  1599             initAllNames(FULL_NAME_ID, aSet);
  1600         } catch (Exception e) {
  1600         } catch (Exception e) {
  1601             /* In case of malformed font */
  1601             /* In case of malformed font */
  1602         }
  1602         }
  1603         return (String[])aSet.toArray(new String[0]);
  1603         return aSet.toArray(new String[0]);
  1604     }
  1604     }
  1605 
  1605 
  1606     /*  Used by the OpenType engine for mark positioning.
  1606     /*  Used by the OpenType engine for mark positioning.
  1607      */
  1607      */
  1608     @Override
  1608     @Override