29 import java.io.BufferedReader; |
29 import java.io.BufferedReader; |
30 import java.io.File; |
30 import java.io.File; |
31 import java.io.FileInputStream; |
31 import java.io.FileInputStream; |
32 import java.io.InputStreamReader; |
32 import java.io.InputStreamReader; |
33 import java.security.AccessController; |
33 import java.security.AccessController; |
34 import java.util.logging.Level; |
|
35 import java.util.logging.Logger; |
|
36 |
34 |
37 import javax.swing.plaf.FontUIResource; |
35 import javax.swing.plaf.FontUIResource; |
38 |
36 |
39 import sun.security.action.GetPropertyAction; |
37 import sun.security.action.GetPropertyAction; |
|
38 import sun.util.logging.PlatformLogger; |
40 |
39 |
41 /** |
40 /** |
42 * A collection of utility methods. |
41 * A collection of utility methods. |
43 */ |
42 */ |
44 public final class FontUtilities { |
43 public final class FontUtilities { |
137 * one 'char' (ie the java type char) does not map to one glyph |
136 * one 'char' (ie the java type char) does not map to one glyph |
138 */ |
137 */ |
139 public static final int MAX_LAYOUT_CHARCODE = 0x206F; |
138 public static final int MAX_LAYOUT_CHARCODE = 0x206F; |
140 |
139 |
141 private static boolean debugFonts = false; |
140 private static boolean debugFonts = false; |
142 private static Logger logger = null; |
141 private static PlatformLogger logger = null; |
143 private static boolean logging; |
142 private static boolean logging; |
144 |
143 |
145 static { |
144 static { |
146 |
145 |
147 String debugLevel = |
146 String debugLevel = |
148 System.getProperty("sun.java2d.debugfonts"); |
147 System.getProperty("sun.java2d.debugfonts"); |
149 |
148 |
150 if (debugLevel != null && !debugLevel.equals("false")) { |
149 if (debugLevel != null && !debugLevel.equals("false")) { |
151 debugFonts = true; |
150 debugFonts = true; |
152 logger = Logger.getLogger("sun.java2d"); |
151 logger = PlatformLogger.getLogger("sun.java2d"); |
153 if (debugLevel.equals("warning")) { |
152 if (debugLevel.equals("warning")) { |
154 logger.setLevel(Level.WARNING); |
153 logger.setLevel(PlatformLogger.WARNING); |
155 } else if (debugLevel.equals("severe")) { |
154 } else if (debugLevel.equals("severe")) { |
156 logger.setLevel(Level.SEVERE); |
155 logger.setLevel(PlatformLogger.SEVERE); |
157 } |
156 } |
158 } |
157 } |
159 |
158 |
160 if (debugFonts) { |
159 if (debugFonts) { |
161 logger = Logger.getLogger("sun.java2d", null); |
160 logger = PlatformLogger.getLogger("sun.java2d"); |
162 logging = logger.getLevel() != Level.OFF; |
161 logging = logger.isEnabled(); |
163 } |
162 } |
164 |
163 |
165 } |
164 } |
166 |
165 |
167 /** |
166 /** |