src/share/classes/sun/awt/FontConfiguration.java

Print this page




2092                                   " property of font configuration.");
2093 
2094                     }
2095                     return EMPTY_INT_ARRAY;
2096                 }
2097                 exclusionRanges[j++] = lo;
2098                 exclusionRanges[j++] = up;
2099             }
2100             return exclusionRanges;
2101         }
2102 
2103         private Short getID(HashMap<String, Short> map, String key) {
2104             Short ret = map.get(key);
2105             if ( ret == null) {
2106                 map.put(key, (short)map.size());
2107                 return map.get(key);
2108             }
2109             return ret;
2110         }
2111 

2112         class FontProperties extends Properties {
2113             public synchronized Object put(Object k, Object v) {
2114                 parseProperty((String)k, (String)v);
2115                 return null;
2116             }
2117         }
2118 
2119         private void parseProperty(String key, String value) {
2120             if (key.startsWith("filename.")) {
2121                 //the only special case is "MingLiu_HKSCS" which has "_" in its
2122                 //facename, we don't want to replace the "_" with " "
2123                 key = key.substring(9);
2124                 if (!"MingLiU_HKSCS".equals(key)) {
2125                     key = key.replace('_', ' ');
2126                 }
2127                 Short faceID = getID(componentFontNameIDs, key);
2128                 Short fileID = getID(fontfileNameIDs, value);
2129                 //System.out.println("faceID=" + faceID + "/" + key + " -> "
2130                 //    + "fileID=" + fileID + "/" + value);
2131                 filenames.put(faceID, fileID);




2092                                   " property of font configuration.");
2093 
2094                     }
2095                     return EMPTY_INT_ARRAY;
2096                 }
2097                 exclusionRanges[j++] = lo;
2098                 exclusionRanges[j++] = up;
2099             }
2100             return exclusionRanges;
2101         }
2102 
2103         private Short getID(HashMap<String, Short> map, String key) {
2104             Short ret = map.get(key);
2105             if ( ret == null) {
2106                 map.put(key, (short)map.size());
2107                 return map.get(key);
2108             }
2109             return ret;
2110         }
2111 
2112         @SuppressWarnings("serial") // JDK-implementation class
2113         class FontProperties extends Properties {
2114             public synchronized Object put(Object k, Object v) {
2115                 parseProperty((String)k, (String)v);
2116                 return null;
2117             }
2118         }
2119 
2120         private void parseProperty(String key, String value) {
2121             if (key.startsWith("filename.")) {
2122                 //the only special case is "MingLiu_HKSCS" which has "_" in its
2123                 //facename, we don't want to replace the "_" with " "
2124                 key = key.substring(9);
2125                 if (!"MingLiU_HKSCS".equals(key)) {
2126                     key = key.replace('_', ' ');
2127                 }
2128                 Short faceID = getID(componentFontNameIDs, key);
2129                 Short fileID = getID(fontfileNameIDs, value);
2130                 //System.out.println("faceID=" + faceID + "/" + key + " -> "
2131                 //    + "fileID=" + fileID + "/" + value);
2132                 filenames.put(faceID, fileID);