src/share/classes/sun/font/SunFontManager.java

Print this page




3041 
3042     /* A call to this method should be followed by a call to
3043      * registerFontDirs(..)
3044      */
3045     protected String getPlatformFontPath(boolean noType1Font) {
3046         if (fontPath == null) {
3047             fontPath = getFontPath(noType1Font);
3048         }
3049         return fontPath;
3050     }
3051 
3052     public static boolean isOpenJDK() {
3053         return FontUtilities.isOpenJDK;
3054     }
3055 
3056     protected void loadFonts() {
3057         if (discoveredAllFonts) {
3058             return;
3059         }
3060         /* Use lock specific to the font system */
3061         synchronized (lucidaFontName) {
3062             if (FontUtilities.debugFonts()) {
3063                 Thread.dumpStack();
3064                 FontUtilities.getLogger()
3065                             .info("SunGraphicsEnvironment.loadFonts() called");
3066             }
3067             initialiseDeferredFonts();
3068 
3069             java.security.AccessController.doPrivileged(
3070                                     new java.security.PrivilegedAction() {
3071                 public Object run() {
3072                     if (fontPath == null) {
3073                         fontPath = getPlatformFontPath(noType1Font);
3074                         registerFontDirs(fontPath);
3075                     }
3076                     if (fontPath != null) {
3077                         // this will find all fonts including those already
3078                         // registered. But we have checks in place to prevent
3079                         // double registration.
3080                         if (! gotFontsFromPlatform()) {
3081                             registerFontsOnPath(fontPath, false,


3177                             boolean preferPropFonts);
3178 
3179     /**
3180      * Returns face name for default font, or null if
3181      * no face names are used for CompositeFontDescriptors
3182      * for this platform.
3183      */
3184     public synchronized String getDefaultFontFaceName() {
3185         if (defaultFontName == null) {
3186             initDefaultFonts();
3187         }
3188         return defaultFontName;
3189     }
3190 
3191     public void loadFontFiles() {
3192         loadFonts();
3193         if (loadedAllFontFiles) {
3194             return;
3195         }
3196         /* Use lock specific to the font system */
3197         synchronized (lucidaFontName) {
3198             if (FontUtilities.debugFonts()) {
3199                 Thread.dumpStack();
3200                 FontUtilities.getLogger().info("loadAllFontFiles() called");
3201             }
3202             java.security.AccessController.doPrivileged(
3203                                     new java.security.PrivilegedAction() {
3204                 public Object run() {
3205                     if (fontPath == null) {
3206                         fontPath = getPlatformFontPath(noType1Font);
3207                     }
3208                     if (fontPath != null) {
3209                         // this will find all fonts including those already
3210                         // registered. But we have checks in place to prevent
3211                         // double registration.
3212                         registerFontsOnPath(fontPath, false,
3213                                             Font2D.UNKNOWN_RANK,
3214                                             false, true);
3215                     }
3216                     loadedAllFontFiles = true;
3217                     return null;




3041 
3042     /* A call to this method should be followed by a call to
3043      * registerFontDirs(..)
3044      */
3045     protected String getPlatformFontPath(boolean noType1Font) {
3046         if (fontPath == null) {
3047             fontPath = getFontPath(noType1Font);
3048         }
3049         return fontPath;
3050     }
3051 
3052     public static boolean isOpenJDK() {
3053         return FontUtilities.isOpenJDK;
3054     }
3055 
3056     protected void loadFonts() {
3057         if (discoveredAllFonts) {
3058             return;
3059         }
3060         /* Use lock specific to the font system */
3061         synchronized (this) {
3062             if (FontUtilities.debugFonts()) {
3063                 Thread.dumpStack();
3064                 FontUtilities.getLogger()
3065                             .info("SunGraphicsEnvironment.loadFonts() called");
3066             }
3067             initialiseDeferredFonts();
3068 
3069             java.security.AccessController.doPrivileged(
3070                                     new java.security.PrivilegedAction() {
3071                 public Object run() {
3072                     if (fontPath == null) {
3073                         fontPath = getPlatformFontPath(noType1Font);
3074                         registerFontDirs(fontPath);
3075                     }
3076                     if (fontPath != null) {
3077                         // this will find all fonts including those already
3078                         // registered. But we have checks in place to prevent
3079                         // double registration.
3080                         if (! gotFontsFromPlatform()) {
3081                             registerFontsOnPath(fontPath, false,


3177                             boolean preferPropFonts);
3178 
3179     /**
3180      * Returns face name for default font, or null if
3181      * no face names are used for CompositeFontDescriptors
3182      * for this platform.
3183      */
3184     public synchronized String getDefaultFontFaceName() {
3185         if (defaultFontName == null) {
3186             initDefaultFonts();
3187         }
3188         return defaultFontName;
3189     }
3190 
3191     public void loadFontFiles() {
3192         loadFonts();
3193         if (loadedAllFontFiles) {
3194             return;
3195         }
3196         /* Use lock specific to the font system */
3197         synchronized (this) {
3198             if (FontUtilities.debugFonts()) {
3199                 Thread.dumpStack();
3200                 FontUtilities.getLogger().info("loadAllFontFiles() called");
3201             }
3202             java.security.AccessController.doPrivileged(
3203                                     new java.security.PrivilegedAction() {
3204                 public Object run() {
3205                     if (fontPath == null) {
3206                         fontPath = getPlatformFontPath(noType1Font);
3207                     }
3208                     if (fontPath != null) {
3209                         // this will find all fonts including those already
3210                         // registered. But we have checks in place to prevent
3211                         // double registration.
3212                         registerFontsOnPath(fontPath, false,
3213                                             Font2D.UNKNOWN_RANK,
3214                                             false, true);
3215                     }
3216                     loadedAllFontFiles = true;
3217                     return null;