< prev index next >

modules/javafx.graphics/src/main/java/com/sun/javafx/font/PrismFontFactory.java

Print this page

        

@@ -54,11 +54,10 @@
     public static final boolean isMacOSX;
     public static final boolean isIOS;
     public static final boolean isAndroid;
     public static final boolean isEmbedded;
     public static final int cacheLayoutSize;
-    static boolean useNativeRasterizer;
     private static int subPixelMode;
     public static final int SUB_PIXEL_ON = 1;
     public static final int SUB_PIXEL_Y = 2;
     public static final int SUB_PIXEL_NATIVE = 4;
     private static float fontSizeLimit = 80f;

@@ -67,11 +66,10 @@
     private static float lcdContrast = -1;
     private static String jreFontDir;
     private static final String jreDefaultFont   = "Lucida Sans Regular";
     private static final String jreDefaultFontLC = "lucida sans regular";
     private static final String jreDefaultFontFile = "LucidaSansRegular.ttf";
-    private static final String T2K_FACTORY = "com.sun.javafx.font.t2k.T2KFactory";
     private static final String CT_FACTORY = "com.sun.javafx.font.coretext.CTFactory";
     private static final String DW_FACTORY = "com.sun.javafx.font.directwrite.DWFactory";
     private static final String FT_FACTORY = "com.sun.javafx.font.freetype.FTFactory";
 
     /* We need two maps. One to hold pointers to the raw fonts, another

@@ -132,21 +130,11 @@
                         } catch (NumberFormatException nfe) {
                             System.err.println("Cannot parse fontSizeLimit '" + s + "'");
                         }
                     }
 
-                    useNativeRasterizer = isMacOSX || isWindows || isLinux;
-                    String defPrismText = useNativeRasterizer ? "native" : "t2k";
-                    String prismText = System.getProperty("prism.text", defPrismText);
-                    if (useNativeRasterizer) {
-                        useNativeRasterizer = !prismText.equals("t2k");
-                    } else {
-                        useNativeRasterizer = prismText.equals("native");
-                    }
-
-                    boolean lcdTextOff = (isMacOSX && !useNativeRasterizer) ||
-                                         isIOS || isAndroid || isEmbedded;
+                    boolean lcdTextOff = isIOS || isAndroid || isEmbedded;
                     String defLCDProp = lcdTextOff ? "false" : "true";
                     String lcdProp = System.getProperty("prism.lcdtext", defLCDProp);
                     lcdEnabled = lcdProp.equals("true");
 
                     s = System.getProperty("prism.cacheLayoutSize");

@@ -199,17 +187,13 @@
     private static PrismFontFactory theFontFactory = null;
     public static synchronized PrismFontFactory getFontFactory() {
         if (theFontFactory != null) {
             return theFontFactory;
         }
-        String factoryClass = null;
-        if (useNativeRasterizer) {
-            factoryClass = getNativeFactoryName();
-        }
+        String factoryClass = getNativeFactoryName();
         if (factoryClass == null) {
-            useNativeRasterizer = false;
-            factoryClass = T2K_FACTORY;
+            throw new InternalError("cannot find a native font factory");
         }
         if (debugFonts) {
             System.err.println("Loading FontFactory " + factoryClass);
             if (subPixelMode != 0) {
                 String s = "Subpixel: enabled";

@@ -222,26 +206,11 @@
                 System.err.println(s);
             }
         }
         theFontFactory = getFontFactory(factoryClass);
         if (theFontFactory == null) {
-            if (useNativeRasterizer) {
-                // If native failed use T2K (i.e. Windows Vista)
-                useNativeRasterizer = false;
-                factoryClass = T2K_FACTORY;
-            } else {
-                // If T2K failed use native (i.e. OpenJFX build)
-                useNativeRasterizer = true;
-                factoryClass = getNativeFactoryName();
-            }
-            if (factoryClass != null) {
-                theFontFactory = getFontFactory(factoryClass);
-            }
-            if (debugFonts) {
-                System.err.println("*** Loading primary font factory failed. ***");
-                System.err.println("*** Fallbacking to " + factoryClass  + " ***");
-            }
+            throw new InternalError("cannot load font factory: "+ factoryClass);
         }
         return theFontFactory;
     }
 
     private static synchronized PrismFontFactory getFontFactory(String factoryClass) {

@@ -524,14 +493,10 @@
                 }
                 if (fr == null) {
                     continue;
                 }
                 storeInMap(lcFontName, fr);
-//                 if (wantComp) {
-//                     // wrap with fallback support
-//                     fr = new T2KCompositeFontResource(fr, lcFontName);
-//                 }
             }
             if (bold == fr.isBold() && italic == fr.isItalic()) {
                 storeInMap(lcFamilyName+styleStr, fr);
                 if (wantComp) {  // wrap with fallback support
                     fr = new PrismCompositeFontResource(fr,

@@ -2041,8 +2006,8 @@
             }
             return monospaceFontFamily;
         }
     }
 
-    /* Called from T2KFontFile which caches the return value */
+    /* Called from PrismFontFile which caches the return value */
     static native short getSystemLCID();
 }
< prev index next >