41 import sun.awt.FontConfiguration; |
41 import sun.awt.FontConfiguration; |
42 import sun.awt.HeadlessToolkit; |
42 import sun.awt.HeadlessToolkit; |
43 import sun.awt.util.ThreadGroupUtils; |
43 import sun.awt.util.ThreadGroupUtils; |
44 import sun.lwawt.macosx.*; |
44 import sun.lwawt.macosx.*; |
45 |
45 |
46 public class CFontManager extends SunFontManager { |
46 public final class CFontManager extends SunFontManager { |
47 private FontConfigManager fcManager = null; |
47 private FontConfigManager fcManager = null; |
48 private static Hashtable<String, Font2D> genericFonts = new Hashtable<String, Font2D>(); |
48 private static Hashtable<String, Font2D> genericFonts = new Hashtable<String, Font2D>(); |
49 |
49 |
50 @Override |
50 @Override |
51 protected FontConfiguration createFontConfiguration() { |
51 protected FontConfiguration createFontConfiguration() { |
59 boolean preferPropFonts) |
59 boolean preferPropFonts) |
60 { |
60 { |
61 return new CFontConfiguration(this, preferLocaleFonts, preferPropFonts); |
61 return new CFontConfiguration(this, preferLocaleFonts, preferPropFonts); |
62 } |
62 } |
63 |
63 |
64 private static String[] defaultPlatformFont = null; |
|
65 |
|
66 /* |
64 /* |
67 * Returns an array of two strings. The first element is the |
65 * Returns an array of two strings. The first element is the |
68 * name of the font. The second element is the file name. |
66 * name of the font. The second element is the file name. |
69 */ |
67 */ |
70 @Override |
68 @Override |
71 public synchronized String[] getDefaultPlatformFont() { |
69 protected String[] getDefaultPlatformFont() { |
72 if (defaultPlatformFont == null) { |
70 return new String[]{"Lucida Grande", |
73 defaultPlatformFont = new String[2]; |
71 "/System/Library/Fonts/LucidaGrande.ttc"}; |
74 defaultPlatformFont[0] = "Lucida Grande"; |
|
75 defaultPlatformFont[1] = "/System/Library/Fonts/LucidaGrande.ttc"; |
|
76 } |
|
77 return defaultPlatformFont; |
|
78 } |
72 } |
79 |
73 |
80 // This is a way to register any kind of Font2D, not just files and composites. |
74 // This is a way to register any kind of Font2D, not just files and composites. |
81 public static Font2D[] getGenericFonts() { |
75 public static Font2D[] getGenericFonts() { |
82 return genericFonts.values().toArray(new Font2D[0]); |
76 return genericFonts.values().toArray(new Font2D[0]); |